Skip to content

Commit db5b56a

Browse files
Merge branch 'main' into dependabot/npm_and_yarn/infra/dataform-service/src/multi-116f458471
2 parents a8d9efe + 9af5527 commit db5b56a

2 files changed

Lines changed: 15 additions & 26 deletions

File tree

.github/workflows/infra.yaml

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ on:
44
push:
55
branches:
66
- main
7-
paths:
8-
- "infra/**"
97

108
concurrency:
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

Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@ clean:
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+
511
tf_plan:
6-
cd infra && terraform init -upgrade && terraform plan
12+
cd infra && terraform plan
713

814
tf_apply:
9-
cd infra && terraform init && terraform apply -auto-approve
15+
cd infra && terraform apply -auto-approve

0 commit comments

Comments
 (0)