From 6206b3f5faa22c8b92a10eaa8f533fe1451dc901 Mon Sep 17 00:00:00 2001 From: Tay Yi Hsuen Date: Tue, 17 Oct 2023 08:56:32 +0800 Subject: [PATCH] Create release 0.1.7 (#115) Fix Docker configuration in prod workflow Co-authored-by: Ong Jun Xiong Co-authored-by: Charisma Kausar Co-authored-by: Charisma Kausar <68203159+ckcherry23@users.noreply.github.com> Co-authored-by: Gabriel Goh <77230723+gycgabriel@users.noreply.github.com> --- .github/workflows/production.yml | 10 +++++----- deployment/build-prod-images.sh | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/production.yml b/.github/workflows/production.yml index 2ba05463..4571d68b 100644 --- a/.github/workflows/production.yml +++ b/.github/workflows/production.yml @@ -32,7 +32,8 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Authenticate to Google Cloud + - id: 'auth' + name: Authenticate to Google Cloud uses: 'google-github-actions/auth@v1' with: workload_identity_provider: projects/345207492413/locations/global/workloadIdentityPools/github-actions-pool/providers/github-actions-oidc @@ -42,11 +43,10 @@ jobs: - name: Setup Google Cloud SDK uses: google-github-actions/setup-gcloud@v1 - # Configure Docker to use the gcloud command-line tool as a credential - # helper for authentication - - name: Configure Docker to use gcloud + # Configure Docker to login to google cloud + - name: Configure Docker run: |- - gcloud --quiet auth configure-docker + echo ${{steps.auth.outputs.access_token}} | docker login -u oauth2accesstoken --password-stdin https://$GKE_REGION-docker.pkg.dev # Get the GKE credentials so that we can deploy to the cluster - name: Get Google Kubernetes Engine credentials for production diff --git a/deployment/build-prod-images.sh b/deployment/build-prod-images.sh index 73f557da..e3cb19c2 100644 --- a/deployment/build-prod-images.sh +++ b/deployment/build-prod-images.sh @@ -7,7 +7,7 @@ service_array=("admin-service" "collaboration-service" "gateway" "matching-servi # Build and publish prod images with context set to be parent directory for s in ${service_array[@]}; do docker build \ - --tag asia-southeast1-docker.pkg.dev/$PROJECT_ID/$ARTIFACT_REPOSITORY_NAME/${service_array[s]}:latest \ + --tag $GKE_REGION-docker.pkg.dev/$PROJECT_ID/$ARTIFACT_REPOSITORY_NAME/${service_array[s]}:latest \ --file prod-dockerfiles/Dockerfile.${service_array[s]}-prod .. - docker push asia-southeast1-docker.pkg.dev/$PROJECT_ID/$ARTIFACT_REPOSITORY_NAME/${service_array[s]}:latest + docker push $GKE_REGION-docker.pkg.dev/$PROJECT_ID/$ARTIFACT_REPOSITORY_NAME/${service_array[s]}:latest done