fix(terraform): align import baseline and local validation flow (#582) #4
This file contains hidden or 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: 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 |