Refactor Terraform CI/CD workflow to use 'ssot-runner' and streamline job steps
Some checks failed
Terraform CI/CD / terraform (push) Has been cancelled
Some checks failed
Terraform CI/CD / terraform (push) Has been cancelled
This commit is contained in:
26
.github/workflows/terraform.yaml
vendored
26
.github/workflows/terraform.yaml
vendored
@@ -2,39 +2,33 @@ name: Terraform CI/CD
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
|
||||||
- "**"
|
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
terraform:
|
terraform:
|
||||||
runs-on: ssot
|
runs-on: ssot-runner
|
||||||
|
|
||||||
|
container:
|
||||||
|
image: hashicorp/terraform:1.6.6
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
apk add --no-cache nodejs npm git
|
||||||
|
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup Terraform
|
|
||||||
uses: hashicorp/setup-terraform@v3
|
|
||||||
with:
|
|
||||||
terraform_version: 1.6.6
|
|
||||||
|
|
||||||
- name: Terraform Init
|
- name: Terraform Init
|
||||||
run: terraform init -input=false
|
run: terraform init -input=false
|
||||||
|
|
||||||
- name: Terraform Format
|
|
||||||
run: terraform fmt -check -recursive
|
|
||||||
|
|
||||||
- name: Terraform Validate
|
- name: Terraform Validate
|
||||||
run: terraform validate
|
run: terraform validate
|
||||||
|
|
||||||
- name: Terraform Plan
|
- name: Terraform Plan
|
||||||
run: |
|
run: terraform plan -input=false -out=tfplan
|
||||||
terraform plan \
|
|
||||||
-input=false \
|
|
||||||
-out=tfplan
|
|
||||||
|
|
||||||
- name: Show Terraform Plan
|
- name: Show plan
|
||||||
run: terraform show -no-color tfplan > plan.txt
|
run: terraform show -no-color tfplan > plan.txt
|
||||||
|
|
||||||
- name: Upload plan artifact
|
- name: Upload plan artifact
|
||||||
|
|||||||
Reference in New Issue
Block a user