cloudrun-sample
Install Google Cloud command line SDK: https://cloud.google.com/sdk/docs/install and Github command line: https://github.com/cli/cli
export PROJECT_ID=<your_project_id_here>
gcloud auth login
gcloud config set project $PROJECT_ID
Using the instructions here: (https://github.com/google-github-actions/setup-gcloud/blob/master/example-workflows/cloud-run/README.md)
gcloud services enable run.googleapis.com
gcloud iam service-accounts create github-actions
gcloud projects add-iam-policy-binding $PROJECT_ID --member serviceAccount:github-actions@${PROJECT_ID}.iam.gserviceaccount.com --role roles/run.admin
gcloud projects add-iam-policy-binding $PROJECT_ID --member serviceAccount:github-actions@${PROJECT_ID}.iam.gserviceaccount.com --role roles/iam.serviceAccountUser
gcloud projects add-iam-policy-binding $PROJECT_ID --member serviceAccount:github-actions@${PROJECT_ID}.iam.gserviceaccount.com --role roles/storage.admin
gcloud iam service-accounts keys create account.json --iam-account github-actions@${PROJECT_ID}.iam.gserviceaccount.com
# Login to Github
gh auth login
# List your Github Repos
gh repo list
# Setup an env var with your target repo
export GH_REPO=<your_github_repo_here>
# Then configure the secrets in the target repo
gh secret set GCP_PROJECT -r $GH_REPO
gh secret set GCP_SA_KEY -r $GH_REPO < account.json
List available workflow:
gh workflow list
To run a pipeline
gh workflow run <workflow_id>