From 7e48b771fbae7c01f708d13e2833052c04f485fb Mon Sep 17 00:00:00 2001 From: Roger13579 <102910435+Roger13579@users.noreply.github.com> Date: Tue, 23 Apr 2024 22:27:19 +0800 Subject: [PATCH 1/8] Update google-cloudrun-docker.yml --- .github/workflows/google-cloudrun-docker.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/google-cloudrun-docker.yml b/.github/workflows/google-cloudrun-docker.yml index bdb4867..e2c15e6 100644 --- a/.github/workflows/google-cloudrun-docker.yml +++ b/.github/workflows/google-cloudrun-docker.yml @@ -94,8 +94,8 @@ jobs: - name: Build and Push Container run: |- - docker build -t "${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.SERVICE }}:${{ github.sha }}" ./ - docker push "${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.SERVICE }}:${{ github.sha }}" + docker build -t "${{ env.GAR_LOCATION }}:${{ github.sha }}" ./ + docker push "${{ env.GAR_LOCATION }}:${{ github.sha }}" # END - Docker auth and build @@ -106,7 +106,7 @@ jobs: service: ${{ env.SERVICE }} region: ${{ env.REGION }} # NOTE: If using a pre-built image, update the image name here - image: ${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.SERVICE }}/${{ env.SERVICE }}:${{ github.sha }} + image: ${{ env.GAR_LOCATION }}:${{ github.sha }} # If required, use the Cloud Run url output in later steps - name: Show Output From 76b3977faa93732105094b2f8914cad7b0b0ae34 Mon Sep 17 00:00:00 2001 From: Roger13579 <102910435+Roger13579@users.noreply.github.com> Date: Tue, 23 Apr 2024 23:06:21 +0800 Subject: [PATCH 2/8] Update google-cloudrun-docker.yml --- .github/workflows/google-cloudrun-docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/google-cloudrun-docker.yml b/.github/workflows/google-cloudrun-docker.yml index e2c15e6..0db139e 100644 --- a/.github/workflows/google-cloudrun-docker.yml +++ b/.github/workflows/google-cloudrun-docker.yml @@ -90,7 +90,7 @@ jobs: with: username: 'oauth2accesstoken' password: '${{ steps.auth.outputs.access_token }}' - registry: '${{ env.GAR_LOCATION }}-docker.pkg.dev' + registry: 'asia-east1-docker.pkg.dev' - name: Build and Push Container run: |- From 9463456d28ce424d0f44c24dfdaf2c725b3708e8 Mon Sep 17 00:00:00 2001 From: Roger13579 <102910435+Roger13579@users.noreply.github.com> Date: Tue, 23 Apr 2024 23:22:43 +0800 Subject: [PATCH 3/8] Update google-cloudrun-docker.yml --- .github/workflows/google-cloudrun-docker.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/google-cloudrun-docker.yml b/.github/workflows/google-cloudrun-docker.yml index 0db139e..c9c9208 100644 --- a/.github/workflows/google-cloudrun-docker.yml +++ b/.github/workflows/google-cloudrun-docker.yml @@ -50,7 +50,7 @@ on: env: PROJECT_ID: sincere-strata-420613 # TODO: update Google Cloud project id - GAR_LOCATION: asia-east1-docker.pkg.dev/sincere-strata-420613/cloud-run-source-deploy # TODO: update Artifact Registry location + GAR_LOCATION: asia-east1 # TODO: update Artifact Registry location SERVICE: ticketsystembackend # TODO: update Cloud Run service name REGION: asia-east1 # TODO: update Cloud Run service region MONGO_DB_URL: ${{ secrets.MONGO_DB_URL }} @@ -90,12 +90,12 @@ jobs: with: username: 'oauth2accesstoken' password: '${{ steps.auth.outputs.access_token }}' - registry: 'asia-east1-docker.pkg.dev' + registry: '${{ env.GAR_LOCATION }}-docker.pkg.dev' - name: Build and Push Container run: |- - docker build -t "${{ env.GAR_LOCATION }}:${{ github.sha }}" ./ - docker push "${{ env.GAR_LOCATION }}:${{ github.sha }}" + docker build -t "${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.SERVICE }}/${{ env.SERVICE }}:${{ github.sha }}" ./ + docker push "${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.SERVICE }}/${{ env.SERVICE }}:${{ github.sha }}" # END - Docker auth and build @@ -106,7 +106,7 @@ jobs: service: ${{ env.SERVICE }} region: ${{ env.REGION }} # NOTE: If using a pre-built image, update the image name here - image: ${{ env.GAR_LOCATION }}:${{ github.sha }} + image: ${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.SERVICE }}/${{ env.SERVICE }}:${{ github.sha }} # If required, use the Cloud Run url output in later steps - name: Show Output From bf637834da76bbb08c4d89f70f2925911ca94408 Mon Sep 17 00:00:00 2001 From: Roger13579 <102910435+Roger13579@users.noreply.github.com> Date: Tue, 23 Apr 2024 23:39:27 +0800 Subject: [PATCH 4/8] Update google-cloudrun-docker.yml --- .github/workflows/google-cloudrun-docker.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/google-cloudrun-docker.yml b/.github/workflows/google-cloudrun-docker.yml index c9c9208..f392010 100644 --- a/.github/workflows/google-cloudrun-docker.yml +++ b/.github/workflows/google-cloudrun-docker.yml @@ -52,6 +52,7 @@ env: PROJECT_ID: sincere-strata-420613 # TODO: update Google Cloud project id GAR_LOCATION: asia-east1 # TODO: update Artifact Registry location SERVICE: ticketsystembackend # TODO: update Cloud Run service name + REPOSITORY: cloud-run-source-deploy REGION: asia-east1 # TODO: update Cloud Run service region MONGO_DB_URL: ${{ secrets.MONGO_DB_URL }} jobs: @@ -94,8 +95,8 @@ jobs: - name: Build and Push Container run: |- - docker build -t "${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.SERVICE }}/${{ env.SERVICE }}:${{ github.sha }}" ./ - docker push "${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.SERVICE }}/${{ env.SERVICE }}:${{ github.sha }}" + docker build -t "${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/${{ env.SERVICE }}:${{ github.sha }}" ./ + docker push "${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/${{ env.SERVICE }}:${{ github.sha }}" # END - Docker auth and build @@ -106,7 +107,7 @@ jobs: service: ${{ env.SERVICE }} region: ${{ env.REGION }} # NOTE: If using a pre-built image, update the image name here - image: ${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.SERVICE }}/${{ env.SERVICE }}:${{ github.sha }} + image: ${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/${{ env.SERVICE }}:${{ github.sha }} # If required, use the Cloud Run url output in later steps - name: Show Output From 171773bb6b053059bf38a5e643233c7b271c08a2 Mon Sep 17 00:00:00 2001 From: Roger13579 <102910435+Roger13579@users.noreply.github.com> Date: Wed, 24 Apr 2024 00:13:14 +0800 Subject: [PATCH 5/8] Update google-cloudrun-docker.yml --- .github/workflows/google-cloudrun-docker.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/google-cloudrun-docker.yml b/.github/workflows/google-cloudrun-docker.yml index f392010..f1421b9 100644 --- a/.github/workflows/google-cloudrun-docker.yml +++ b/.github/workflows/google-cloudrun-docker.yml @@ -54,7 +54,6 @@ env: SERVICE: ticketsystembackend # TODO: update Cloud Run service name REPOSITORY: cloud-run-source-deploy REGION: asia-east1 # TODO: update Cloud Run service region - MONGO_DB_URL: ${{ secrets.MONGO_DB_URL }} jobs: deploy: # Add 'id-token' with the intended permissions for workload identity federation @@ -94,6 +93,8 @@ jobs: registry: '${{ env.GAR_LOCATION }}-docker.pkg.dev' - name: Build and Push Container + env: + MONGO_DB_URL: ${{ secrets.MONGO_DB_URL }} run: |- docker build -t "${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/${{ env.SERVICE }}:${{ github.sha }}" ./ docker push "${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/${{ env.SERVICE }}:${{ github.sha }}" From 7964bfe85fb6e60907995ad294e26ffe54a43b88 Mon Sep 17 00:00:00 2001 From: Roger13579 <102910435+Roger13579@users.noreply.github.com> Date: Wed, 24 Apr 2024 00:28:43 +0800 Subject: [PATCH 6/8] Update google-cloudrun-docker.yml --- .github/workflows/google-cloudrun-docker.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/google-cloudrun-docker.yml b/.github/workflows/google-cloudrun-docker.yml index f1421b9..d16f117 100644 --- a/.github/workflows/google-cloudrun-docker.yml +++ b/.github/workflows/google-cloudrun-docker.yml @@ -92,6 +92,11 @@ jobs: password: '${{ steps.auth.outputs.access_token }}' registry: '${{ env.GAR_LOCATION }}-docker.pkg.dev' + - name: 'Create env file' + run: |- + touch .env + echo MONGO_DB_URL=${{ secrets.MONGO_DB_URL }} >> .env + cat .env - name: Build and Push Container env: MONGO_DB_URL: ${{ secrets.MONGO_DB_URL }} From 538d56ea4399533a30e1a7cf323b368101522cc4 Mon Sep 17 00:00:00 2001 From: Roger13579 <102910435+Roger13579@users.noreply.github.com> Date: Wed, 24 Apr 2024 00:33:57 +0800 Subject: [PATCH 7/8] Update google-cloudrun-docker.yml --- .github/workflows/google-cloudrun-docker.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/google-cloudrun-docker.yml b/.github/workflows/google-cloudrun-docker.yml index d16f117..403115c 100644 --- a/.github/workflows/google-cloudrun-docker.yml +++ b/.github/workflows/google-cloudrun-docker.yml @@ -92,15 +92,11 @@ jobs: password: '${{ steps.auth.outputs.access_token }}' registry: '${{ env.GAR_LOCATION }}-docker.pkg.dev' - - name: 'Create env file' + - name: Build and Push Container run: |- touch .env echo MONGO_DB_URL=${{ secrets.MONGO_DB_URL }} >> .env cat .env - - name: Build and Push Container - env: - MONGO_DB_URL: ${{ secrets.MONGO_DB_URL }} - run: |- docker build -t "${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/${{ env.SERVICE }}:${{ github.sha }}" ./ docker push "${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/${{ env.SERVICE }}:${{ github.sha }}" From a82a86287feeeb99164a644fb8752d42c40ce963 Mon Sep 17 00:00:00 2001 From: Roger13579 <102910435+Roger13579@users.noreply.github.com> Date: Wed, 24 Apr 2024 23:05:36 +0800 Subject: [PATCH 8/8] Update google-cloudrun-docker.yml --- .github/workflows/google-cloudrun-docker.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/google-cloudrun-docker.yml b/.github/workflows/google-cloudrun-docker.yml index 403115c..ae0d36d 100644 --- a/.github/workflows/google-cloudrun-docker.yml +++ b/.github/workflows/google-cloudrun-docker.yml @@ -94,9 +94,6 @@ jobs: - name: Build and Push Container run: |- - touch .env - echo MONGO_DB_URL=${{ secrets.MONGO_DB_URL }} >> .env - cat .env docker build -t "${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/${{ env.SERVICE }}:${{ github.sha }}" ./ docker push "${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPOSITORY }}/${{ env.SERVICE }}:${{ github.sha }}"