Switch the import path (#33) #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to Cloud Run | |
on: | |
push: | |
branches: [ "main" ] | |
workflow_dispatch: | |
concurrency: deploy | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read # clone the repository contents | |
id-token: write # federates with GCP | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v3 | |
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 | |
with: | |
go-version-file: './go.mod' | |
check-latest: true | |
- uses: google-github-actions/auth@f6de81663f7788d05bd15bcce18f0e57f23f0846 # v0 | |
id: auth | |
with: | |
token_format: 'access_token' | |
project_id: 'octo-sts' | |
workload_identity_provider: 'projects/96355665038/locations/global/workloadIdentityPools/github-pool/providers/github-provider' | |
service_account: '[email protected]' | |
- uses: 'docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d' # v2 | |
with: | |
username: 'oauth2accesstoken' | |
password: '${{ steps.auth.outputs.access_token }}' | |
registry: 'gcr.io' | |
# Attempt to deploy the terraform configuration | |
- uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 # v2.0.0 | |
with: | |
terraform_version: 1.6 | |
- working-directory: ./iac | |
run: | | |
terraform init | |
terraform plan | |
terraform apply -auto-approve |