Skip to content

Instantly share code, notes, and snippets.

@grant
Last active May 18, 2021 16:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grant/030c83eabe8211cb54abb2d32bacf348 to your computer and use it in GitHub Desktop.
Save grant/030c83eabe8211cb54abb2d32bacf348 to your computer and use it in GitHub Desktop.
A GitHub Workflow that deploys a Cloud Workflow
name: Deploy Cloud Workflow
on:
push:
branches:
- main
jobs:
deploy:
name: Deploy Cloud Workflow
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@master
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
service_account_key: ${{ secrets.GCP_SA_KEY }}
export_default_credentials: true
- name: Use gcloud CLI
run: |
gcloud workflows deploy myWorkflowFromGitHub \
--location us-central1 \
--source myFirstWorkflow.workflows.yaml \
--project ${{ secrets.GCP_PROJECT_ID }} \
--labels "commit-sha=${{ github.sha }}" \
--service-account my-wf-service-account@${{ secrets.GCP_PROJECT_ID }}.iam.gserviceaccount.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment