name: Destroy Infrastructure # Manual trigger only - for safety on: workflow_dispatch: inputs: confirm: description: 'Type "DESTROY" to confirm' required: true type: string jobs: destroy: name: Destroy Infrastructure runs-on: self-hosted if: github.event.inputs.confirm == 'DESTROY' steps: - name: Checkout code uses: actions/checkout@v4 - name: Setup OpenTofu run: | if ! command -v tofu &> /dev/null; then curl -fsSL https://get.opentofu.org/install-opentofu.sh | bash fi - name: Confirm Destruction run: | echo "⚠️ WARNING: This will destroy all infrastructure!" echo "Proceeding in 10 seconds..." sleep 10 - name: Terraform Destroy run: | cd terraform # Create tfvars from secrets cat > terraform.tfvars <