Files
infrastructure/.github/workflows/terraform.yaml
Noah 91e2ef0d9e
Some checks failed
Terraform CI/CD / terraform (push) Failing after 2s
modified terraform cicd
2025-12-23 17:49:09 +01:00

48 lines
1.1 KiB
YAML

name: Terraform CI/CD
on:
push:
branches: [ main ]
jobs:
terraform:
runs-on: ssot
defaults:
run:
working-directory: terraform
container:
image: hashicorp/terraform:1.6.6
steps:
- name: Install dependencies
run: apk add --no-cache nodejs npm git
- name: Checkout repository
uses: actions/checkout@v4
- name: Terraform Init
run: terraform -chdir=terraform init -input=false
- name: Terraform Validate
run: terraform -chdir=terraform validate
- name: Terraform Plan
run: terraform -chdir=terraform plan -input=false -out=tfplan
- name: Show plan
run: terraform -chdir=terraform show -no-color tfplan > terraform/plan.txt
- name: Upload plan artifact
uses: actions/upload-artifact@v3
with:
name: terraform-plan
path: |
terraform/tfplan
terraform/plan.txt
- name: Terraform Apply
if: github.ref == 'refs/heads/main'
run: terraform -chdir=terraform apply -input=false -auto-approve tfplan