-
Notifications
You must be signed in to change notification settings - Fork 15
50 lines (39 loc) · 1.4 KB
/
deploy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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