From 370077ab1b331f0dda161959717c1c5e3cd7e0c9 Mon Sep 17 00:00:00 2001 From: dike Date: Thu, 10 Oct 2024 15:42:07 +0800 Subject: [PATCH] update --- .github/workflows/docker-image.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 156de5fa18..f0252b4335 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -6,16 +6,24 @@ on: env: REGION: us-east-1 - ECR_REGISTRY_ID: 346509735976 # AWS_ASSUMED_ROLE_ARN: arn:aws:iam::553885929720:role/tf_nodereal_prod_ecr_cicd_deployment_assume_role jobs: - build: + qa-ci-build: runs-on: [self-hosted,qa-cicd-runners] steps: - uses: actions/checkout@v2 - name: Build the Docker image to Amazon ECR run: | - aws ecr get-login-password --region ${REGION} | docker login --username AWS --password-stdin ${ECR_REGISTRY_ID}.dkr.ecr.${REGION}.amazonaws.com - docker build --build-arg profile=prod --build-arg GIT_TOKEN=${{ secrets.GO_MODULES_TOKEN }} -t ${ECR_REGISTRY_ID}.dkr.ecr.${REGION}.amazonaws.com/${GITHUB_REPOSITORY#*/}:${GITHUB_SHA} . - docker push ${ECR_REGISTRY_ID}.dkr.ecr.${REGION}.amazonaws.com/${GITHUB_REPOSITORY#*/}:${GITHUB_SHA} + aws ecr get-login-password --region ${REGION} | docker login --username AWS --password-stdin 346509735976.dkr.ecr.${REGION}.amazonaws.com + docker build --build-arg profile=prod --build-arg GIT_TOKEN=${{ secrets.GO_MODULES_TOKEN }} -t 346509735976.dkr.ecr.${REGION}.amazonaws.com/${GITHUB_REPOSITORY#*/}:${GITHUB_SHA} . + docker push 346509735976.dkr.ecr.${REGION}.amazonaws.com/${GITHUB_REPOSITORY#*/}:${GITHUB_SHA} + prod-ci-build: + runs-on: [prod-cicd-runners] + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image to Amazon ECR + run: | + aws ecr get-login-password --region ${REGION} | docker login --username AWS --password-stdin 553885929720.dkr.ecr.${REGION}.amazonaws.com + docker build --build-arg profile=prod --build-arg GIT_TOKEN=${{ secrets.GO_MODULES_TOKEN }} -t 553885929720.dkr.ecr.${REGION}.amazonaws.com/${GITHUB_REPOSITORY#*/}:${GITHUB_SHA} . + docker push 553885929720.dkr.ecr.${REGION}.amazonaws.com/${GITHUB_REPOSITORY#*/}:${GITHUB_SHA}