modified ghactions-ci.yml #3
This file contains 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 Workflow | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
terraform-lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Terraform Format Check | |
id: fmt | |
uses: hashicorp/setup-terraform@v3 | |
with: | |
terraform_version: 1.7.5 | |
run: terraform fmt -diff -check -recursive" | |
terraform-init: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Terraform Init | |
id: init | |
uses: hashicorp/setup-terraform@v3 | |
with: | |
terraform_version: 1.7.5 | |
run: terraform init | |
terraform-plan: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Terraform Plan | |
uses: hashicorp/setup-terraform@v3 | |
with: | |
terraform_version: 1.7.5 | |
run: terraform plan | |
env: | |
METAL_AUTH_TOKEN: ${{ secrets.metal_auth_token }} | |
TF_VAR_project_name: ${{ secrets.project_name }} |