Skip to content

Commit

Permalink
Update google-cloudrun-source.yml (#6)
Browse files Browse the repository at this point in the history
Updating workflow to deploy source code on Cloud Run when a commit is pushed to the "master" branch

Signed-off-by: pasilvagh <pasilvagh@gmail.com>
  • Loading branch information
pasilvagh authored Feb 6, 2024
1 parent a8087c2 commit 27d3a5b
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/google-cloudrun-source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,44 @@ env:
PROJECT_ID: YOUR_PROJECT_ID # TODO: update Google Cloud project id
SERVICE: YOUR_SERVICE_NAME # TODO: update Cloud Run service name
REGION: YOUR_SERVICE_REGION # TODO: update Cloud Run service region


jobs:
deploy:
# Add 'id-token' with the intended permissions for workload identity federation
permissions:
contents: 'read'
id-token: 'write'

runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

# - name: Google Auth
# id: auth
# uses: 'google-github-actions/auth@v0'
# with:
# workload_identity_provider: '${{ secrets.WIF_PROVIDER }}' # e.g. - projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider
# service_account: '${{ secrets.WIF_SERVICE_ACCOUNT }}' # e.g. - my-service-account@my-project.iam.gserviceaccount.com

# NOTE: Alternative option - authentication via credentials json
# - name: Google Auth
# id: auth
# uses: 'google-github-actions/auth@v0'
# with:
# credentials_json: '${{ secrets.GCP_CREDENTIALS }}'

# - name: Deploy to Cloud Run
# id: deploy
# uses: google-github-actions/deploy-cloudrun@v0
# with:
# service: ${{ env.SERVICE }}
# region: ${{ env.REGION }}
# # NOTE: If required, update to the appropriate source folder
# source: ./

# If required, use the Cloud Run url output in later steps
- name: Show Output
run: echo ${{ steps.deploy.outputs }}
# run: echo ${{ steps.deploy.outputs.url }}

0 comments on commit 27d3a5b

Please sign in to comment.