-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (35 loc) · 1.08 KB
/
terraform-validate.yml
File metadata and controls
41 lines (35 loc) · 1.08 KB
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
name: Terraform Validate
on:
pull_request:
paths:
- "infra/terraform/**"
- ".github/workflows/terraform-validate.yml"
push:
branches:
- staging
- main
paths:
- "infra/terraform/**"
- ".github/workflows/terraform-validate.yml"
jobs:
terraform-validate:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: 1.5.7
- name: Terraform fmt check
run: terraform -chdir=infra/terraform fmt -check -recursive
- name: Terraform init and validate (staging)
run: |
terraform -chdir=infra/terraform/environments/staging init -backend=false
terraform -chdir=infra/terraform/environments/staging validate
- name: Terraform init and validate (prod)
run: |
terraform -chdir=infra/terraform/environments/prod init -backend=false
terraform -chdir=infra/terraform/environments/prod validate