Ensure the cluster is always destroyed

Always teardown the cluster if the terraform apply step has started to run, regardless of its result.
This commit is contained in:
E M 2026-04-17 15:25:56 +10:00
parent 65f101891d
commit 2e989e59ef
No known key found for this signature in database

View File

@ -237,6 +237,7 @@ jobs:
run: terraform init
- name: Terraform apply
id: tf-apply
working-directory: ${{ env.TF_DIR }}
run: terraform apply -auto-approve
@ -291,7 +292,7 @@ jobs:
[[ "$job_status" == "SuccessCriteriaMet" ]] || exit 1
- name: Terraform destroy
if: always()
if: always() && steps.tf-apply.conclusion != 'skipped'
working-directory: ${{ env.TF_DIR }}
run: terraform destroy -auto-approve