-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (46 loc) · 1.2 KB
/
cd.infra.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
51
52
53
54
55
56
57
58
name: CD Infra
on:
push:
paths:
- infra/**
- .github/workflows/cd.infra.yaml
branches:
- main
env:
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GCP_CD }}
PROJECT: "artist-2d"
DEPLOY_ENV: "dev"
REGION: "us-west1"
defaults:
run:
working-directory: infra/app
jobs:
tf_app:
name: "Terraform App"
runs-on: "ubuntu-latest"
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
credentials_json: '${{ secrets.GCP_CD }}'
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
with:
version: '>= 363.0.0'
- name: Docker auth for GCP Artifact Registry
run: |-
gcloud auth configure-docker ${{ env.REGION }}-docker.pkg.dev --quiet
- uses: hashicorp/setup-terraform@v3
with:
terraform_version: 1.4
terraform_wrapper: false
- name: Init Terraform
run: |
terraform init
terraform refresh
- name: Update Infra
run: |
terraform plan -no-color
terraform apply -no-color -auto-approve