From 778149a86299c3a39953cdd9ad19b2885eed01c7 Mon Sep 17 00:00:00 2001 From: davidh16 <87704377+davidh16@users.noreply.github.com> Date: Tue, 27 Aug 2024 17:09:54 +0200 Subject: [PATCH 1/9] Update google-cloudrun-docker.yml --- .github/workflows/google-cloudrun-docker.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/google-cloudrun-docker.yml b/.github/workflows/google-cloudrun-docker.yml index 6ffddcd..74079e3 100644 --- a/.github/workflows/google-cloudrun-docker.yml +++ b/.github/workflows/google-cloudrun-docker.yml @@ -53,17 +53,17 @@ on: branches: - master -env: - PROJECT_ID: ${{ secrets.PROJECT_ID }} - GAR_LOCATION: ${{ secrets.GAR_LOCATION }} - SERVICE: ${{ secrets.SERVICE }} - REGION: ${{ secrets.REGION }} - jobs: deploy: environment: name: ${{ github.ref == 'refs/heads/master' && 'production' || 'debug' }} - + + env: + PROJECT_ID: ${{ secrets.PROJECT_ID }} + GAR_LOCATION: ${{ secrets.GAR_LOCATION }} + SERVICE: ${{ secrets.SERVICE }} + REGION: ${{ secrets.REGION }} + permissions: contents: 'read' id-token: 'write' From 93783fd890b049dff79f682658df436484a101d3 Mon Sep 17 00:00:00 2001 From: davidh16 <87704377+davidh16@users.noreply.github.com> Date: Tue, 27 Aug 2024 17:18:27 +0200 Subject: [PATCH 2/9] Update google-cloudrun-docker.yml --- .github/workflows/google-cloudrun-docker.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/google-cloudrun-docker.yml b/.github/workflows/google-cloudrun-docker.yml index 74079e3..32c8c51 100644 --- a/.github/workflows/google-cloudrun-docker.yml +++ b/.github/workflows/google-cloudrun-docker.yml @@ -88,6 +88,9 @@ jobs: username: _json_key password: ${{ secrets.GCR_SERVICE_ACCOUNT_JSON }} + - name: Print env for debuging + run: printenv + # Build and push the Docker image, passing the .env_file - name: Build and Push Container From 0b364f5cbde7ac994717a6f576559aa26a9ce7e7 Mon Sep 17 00:00:00 2001 From: davidh16 <87704377+davidh16@users.noreply.github.com> Date: Tue, 27 Aug 2024 17:20:26 +0200 Subject: [PATCH 3/9] Update google-cloudrun-docker.yml --- .github/workflows/google-cloudrun-docker.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/google-cloudrun-docker.yml b/.github/workflows/google-cloudrun-docker.yml index 32c8c51..152897c 100644 --- a/.github/workflows/google-cloudrun-docker.yml +++ b/.github/workflows/google-cloudrun-docker.yml @@ -89,8 +89,7 @@ jobs: password: ${{ secrets.GCR_SERVICE_ACCOUNT_JSON }} - name: Print env for debuging - run: printenv - + run: echo '${{ toJSON(vars) }}' # Build and push the Docker image, passing the .env_file - name: Build and Push Container From 02089c3fbf7165c85dc09f0ee7474ed5a2abf907 Mon Sep 17 00:00:00 2001 From: davidh16 <87704377+davidh16@users.noreply.github.com> Date: Tue, 27 Aug 2024 18:39:09 +0200 Subject: [PATCH 4/9] Update google-cloudrun-docker.yml --- .github/workflows/google-cloudrun-docker.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/google-cloudrun-docker.yml b/.github/workflows/google-cloudrun-docker.yml index 152897c..3893b77 100644 --- a/.github/workflows/google-cloudrun-docker.yml +++ b/.github/workflows/google-cloudrun-docker.yml @@ -130,6 +130,7 @@ jobs: env_vars: ${{ steps.prepare-env.outputs.env_vars }} service: ${{ env.SERVICE }} region: ${{ env.REGION }} + project: ${{ env.PROJECT_ID }} 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 From b6c706b0675310a522c390ec03b5fb7e1475df74 Mon Sep 17 00:00:00 2001 From: davidh16 <87704377+davidh16@users.noreply.github.com> Date: Tue, 27 Aug 2024 18:41:02 +0200 Subject: [PATCH 5/9] 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 3893b77..5d99000 100644 --- a/.github/workflows/google-cloudrun-docker.yml +++ b/.github/workflows/google-cloudrun-docker.yml @@ -130,7 +130,7 @@ jobs: env_vars: ${{ steps.prepare-env.outputs.env_vars }} service: ${{ env.SERVICE }} region: ${{ env.REGION }} - project: ${{ env.PROJECT_ID }} + project_id: ${{ env.PROJECT_ID }} 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 From 88f0df4171099477a6d8f4251d310803054d5e56 Mon Sep 17 00:00:00 2001 From: davidh16 <87704377+davidh16@users.noreply.github.com> Date: Tue, 27 Aug 2024 18:50:03 +0200 Subject: [PATCH 6/9] 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 5d99000..0b76b7b 100644 --- a/.github/workflows/google-cloudrun-docker.yml +++ b/.github/workflows/google-cloudrun-docker.yml @@ -87,9 +87,6 @@ jobs: registry: ${{ env.GAR_LOCATION }}-docker.pkg.dev username: _json_key password: ${{ secrets.GCR_SERVICE_ACCOUNT_JSON }} - - - name: Print env for debuging - run: echo '${{ toJSON(vars) }}' # Build and push the Docker image, passing the .env_file - name: Build and Push Container @@ -123,6 +120,9 @@ jobs: #remove no longer needed env_vars.json file rm -f env_vars.json + - name: print out env + run: echo ${{ steps.prepare-env.outputs.env_vars }} + - name: Deploy to Cloud Run id: deploy uses: google-github-actions/deploy-cloudrun@v0 From 1603ba0ff06deab47920c966967138031a91c434 Mon Sep 17 00:00:00 2001 From: davidh16 <87704377+davidh16@users.noreply.github.com> Date: Tue, 27 Aug 2024 18:59:29 +0200 Subject: [PATCH 7/9] Update google-cloudrun-docker.yml --- .github/workflows/google-cloudrun-docker.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/google-cloudrun-docker.yml b/.github/workflows/google-cloudrun-docker.yml index 0b76b7b..ef599c3 100644 --- a/.github/workflows/google-cloudrun-docker.yml +++ b/.github/workflows/google-cloudrun-docker.yml @@ -117,6 +117,8 @@ jobs: env_vars=$(jq -r 'to_entries | map("\(.key)=\(.value)") | join(",")' env_vars.json) + echo ${{ env_vars }} + #remove no longer needed env_vars.json file rm -f env_vars.json From 6d41de2e1300a9acb17aded3dc3a7888dd8e533e Mon Sep 17 00:00:00 2001 From: davidh16 <87704377+davidh16@users.noreply.github.com> Date: Tue, 27 Aug 2024 19:04:46 +0200 Subject: [PATCH 8/9] Update google-cloudrun-docker.yml --- .github/workflows/google-cloudrun-docker.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/google-cloudrun-docker.yml b/.github/workflows/google-cloudrun-docker.yml index ef599c3..01fc350 100644 --- a/.github/workflows/google-cloudrun-docker.yml +++ b/.github/workflows/google-cloudrun-docker.yml @@ -115,15 +115,17 @@ jobs: echo '${{ toJSON(vars) }}' > env_vars.json cat env_vars.json - env_vars=$(jq -r 'to_entries | map("\(.key)=\(.value)") | join(",")' env_vars.json) - - echo ${{ env_vars }} + #env_vars=$(jq -r 'to_entries | map("\(.key)=\(.value)") | join(",")' env_vars.json) #remove no longer needed env_vars.json file - rm -f env_vars.json + #rm -f env_vars.json + + - name: print json + id: json + run: env_vars=$(jq -r 'to_entries | map("\(.key)=\(.value)") | join(",")' env_vars.json) - name: print out env - run: echo ${{ steps.prepare-env.outputs.env_vars }} + run: echo ${{ steps.json.outputs.env_vars }} - name: Deploy to Cloud Run id: deploy From 600833547d3b6ef59edb9a42e1968f8d49126ccb Mon Sep 17 00:00:00 2001 From: davidh16 <87704377+davidh16@users.noreply.github.com> Date: Tue, 27 Aug 2024 23:02:58 +0200 Subject: [PATCH 9/9] 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 01fc350..11cd82a 100644 --- a/.github/workflows/google-cloudrun-docker.yml +++ b/.github/workflows/google-cloudrun-docker.yml @@ -115,15 +115,15 @@ jobs: echo '${{ toJSON(vars) }}' > env_vars.json cat env_vars.json - #env_vars=$(jq -r 'to_entries | map("\(.key)=\(.value)") | join(",")' env_vars.json) + env_vars=$(jq -r 'to_entries | map("\(.key)=\(.value)") | join(",")' env_vars.json) + + echo "env_vars=$env_vars" + # Set the output variable for the step + echo "::set-output name=env_vars::$env_vars" #remove no longer needed env_vars.json file #rm -f env_vars.json - - name: print json - id: json - run: env_vars=$(jq -r 'to_entries | map("\(.key)=\(.value)") | join(",")' env_vars.json) - - name: print out env run: echo ${{ steps.json.outputs.env_vars }}