Deploy #1055
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 | |
on: | |
schedule: | |
- cron: '0 1 * * *' # 1AM UTC; 9PM Eastern | |
push: | |
branches: ['main'] | |
workflow_dispatch: | |
jobs: | |
deploy: | |
name: Deploy | |
runs-on: ['ubuntu-latest'] | |
permissions: | |
id-token: write | |
contents: read | |
env: | |
KO_DOCKER_REPO: gcr.io/kontaindotme | |
TF_VAR_domain: kontain.me | |
TF_VAR_project_id: kontaindotme | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version-file: 'go.mod' | |
- uses: hashicorp/setup-terraform@v2 | |
- uses: imjasonh/setup-crane@v0.3 | |
# Setup OIDC->SA auth | |
- uses: google-github-actions/auth@v1 | |
id: auth | |
with: | |
workload_identity_provider: 'projects/7577580991/locations/global/workloadIdentityPools/gha-pool/providers/gha-provider' | |
service_account: 'gha-deployer@kontaindotme.iam.gserviceaccount.com' | |
- uses: google-github-actions/setup-gcloud@v1.1.1 | |
with: | |
project_id: kontaindotme | |
- name: Terraform Plan and Apply | |
run: | | |
terraform init | |
terraform plan -input=false -lock=false -out=plan.tmp | |
terraform apply -auto-approve -input=false plan.tmp |