Skip to content

Commit

Permalink
Merge branch 'master' into debug
Browse files Browse the repository at this point in the history
  • Loading branch information
davidh16 authored Aug 28, 2024
2 parents a82854a + 99dbdb4 commit 7c224b0
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions .github/workflows/google-cloudrun-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -87,7 +87,6 @@ jobs:
registry: ${{ env.GAR_LOCATION }}-docker.pkg.dev
username: _json_key
password: ${{ secrets.GCR_SERVICE_ACCOUNT_JSON }}


# Build and push the Docker image, passing the .env_file
- name: Build and Push Container
Expand All @@ -107,10 +106,14 @@ jobs:
env_vars=$(jq -r 'to_entries | map("\(.key)=\(.value)") | join(",")' env_vars.json)
# 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
#rm -f env_vars.json
- name: print out env
run: echo ${{ steps.json.outputs.env_vars }}

- name: Deploy to Cloud Run
id: deploy
Expand All @@ -119,6 +122,7 @@ jobs:
env_vars: ${{ steps.prepare-env.outputs.env_vars }}
service: ${{ env.SERVICE }}
region: ${{ env.REGION }}
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
Expand Down

0 comments on commit 7c224b0

Please sign in to comment.