From dfdcfdd80b8c45ffdb513d44c384f6982b540e0a Mon Sep 17 00:00:00 2001 From: Noah Date: Tue, 23 Dec 2025 14:54:22 +0100 Subject: [PATCH] Update Terraform CI/CD workflow to use 'ssot-runner' and adjust working directory for commands --- .github/workflows/terraform.yaml | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/.github/workflows/terraform.yaml b/.github/workflows/terraform.yaml index f824bd2..d346c4d 100644 --- a/.github/workflows/terraform.yaml +++ b/.github/workflows/terraform.yaml @@ -6,43 +6,38 @@ on: jobs: terraform: - runs-on: ssot + runs-on: ssot-runner container: image: hashicorp/terraform:1.6.6 - defaults: - run: - working-directory: /workspace/${{ github.repository }}/terraform - steps: - name: Install dependencies - run: | - apk add --no-cache nodejs npm git + run: apk add --no-cache nodejs npm git - name: Checkout repository uses: actions/checkout@v4 - name: Terraform Init - run: terraform init -input=false + run: terraform -chdir=terraform init -input=false - name: Terraform Validate - run: terraform validate + run: terraform -chdir=terraform validate - name: Terraform Plan - run: terraform plan -input=false -out=tfplan + run: terraform -chdir=terraform plan -input=false -out=tfplan - name: Show plan - run: terraform show -no-color tfplan > plan.txt + 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: | - tfplan - plan.txt + terraform/tfplan + terraform/plan.txt - name: Terraform Apply if: github.ref == 'refs/heads/main' - run: terraform apply -input=false -auto-approve tfplan + run: terraform -chdir=terraform apply -input=false -auto-approve tfplan