Skip to content

Deploy to Google Cloud Run #30

Deploy to Google Cloud Run

Deploy to Google Cloud Run #30

name: Deploy to Google Cloud Run
on:
workflow_run:
workflows: ["Docker Build"]
types:
- completed
permissions:
contents: read
id-token: write
jobs:
deploy:
runs-on: ubuntu-latest
env:
tag: latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Authenticate to Google Cloud using Workload Identity Federation
uses: google-github-actions/auth@v2
with:
workload_identity_provider: 'projects/70756149774/locations/global/workloadIdentityPools/github-actions/providers/github-repos'
service_account: 'hshn-devsecops-service-account@hs-heilbronn-devsecops.iam.gserviceaccount.com'
- name: Set Google Cloud Project and Region
run: |
gcloud config set project 707561499774
gcloud config set run/region europe-west3
- name: Deploy to Cloud Run
uses: google-github-actions/deploy-cloudrun@v1
with:
service: note-api-hs-heilbronn-fireballs
image: docker.io/elenagaz/note-api:${{ env.tag }}
env_vars: BACKEND=memory
region: europe-west3
flags: --allow-unauthenticated