File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44 push :
55 branches :
66 - main
7- paths :
8- - " infra/**"
97
108concurrency :
119 group : ${{ github.workflow }}-${{ github.ref }}
@@ -22,35 +20,20 @@ jobs:
2220 steps :
2321 - name : Checkout code
2422 uses : actions/checkout@v6
25- with :
26- persist-credentials : false
2723
2824 - name : Authenticate with Google Cloud
2925 uses : google-github-actions/auth@v3
3026 with :
31- project_id : " httparchive"
32- credentials_json : " ${{ secrets.GCP_SA_KEY }}"
27+ project_id : ' httparchive'
28+ credentials_json : ${{ secrets.GCP_SA_KEY }}
3329
3430 - name : Set up Terraform
35- uses : hashicorp/setup-terraform@v3.1.2
36-
37- - name : Terraform Format Check
38- working-directory : ./infra
39- run : terraform fmt -check
31+ uses : hashicorp/setup-terraform@v3
4032
4133 - name : Initialize Terraform
42- working-directory : ./infra
43- run : terraform init
44-
45- - name : Validate Terraform
46- working-directory : ./infra
47- run : terraform validate
48-
49- - name : Plan Terraform
50- working-directory : ./infra
51- run : terraform plan -out=tfplan
34+ run : |
35+ make tf_init
36+ make tf_lint
5237
5338 - name : Apply Terraform
54- if : github.ref == 'refs/heads/main' && github.event_name == 'push'
55- working-directory : ./infra
56- run : terraform apply -auto-approve tfplan
39+ run : make tf_apply
Original file line number Diff line number Diff line change 22 rm -rf ./infra/bigquery-export/node_modules
33 rm -rf ./infra/dataform-service/node_modules
44
5+ tf_init :
6+ cd infra && terraform init -upgrade
7+
8+ tf_lint :
9+ cd infra && terraform fmt -check && terraform validate
10+
511tf_plan :
6- cd infra && terraform init -upgrade && terraform plan
12+ cd infra && terraform plan
713
814tf_apply :
9- cd infra && terraform init && terraform apply -auto-approve
15+ cd infra && terraform apply -auto-approve
You can’t perform that action at this time.
0 commit comments