Removed production PAAS from workflow #1057
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Destroy Review Instance | |
on: | |
pull_request: | |
types: [closed] | |
jobs: | |
destroy: | |
name: Destroy | |
environment: | |
name: Review | |
runs-on: ubuntu-latest | |
concurrency: Review_${{github.event.number}} | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: set-up-environment | |
uses: DFE-Digital/github-actions/set-up-environment@master | |
- name: Setup Environment Variables | |
id: variables | |
run: | | |
echo "pr_name=${{env.REVIEW_APPLICATION}}-${{github.event.number}}" >> $GITHUB_OUTPUT | |
- uses: hashicorp/setup-terraform@v2 | |
with: | |
terraform_version: 1.2.8 | |
- name: Terraform Destroy | |
run: | | |
cd terraform/paas && pwd | |
terraform init -backend-config=review.bk.vars -backend-config="key=${{steps.variables.outputs.pr_name}}.tfstate" | |
terraform destroy -var-file=review.env.tfvars -auto-approve | |
env: | |
ARM_ACCESS_KEY: ${{ secrets.ARM_ACCESS_KEY }} | |
TF_VAR_AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} | |
- name: Delete Terraform State File | |
run: az storage blob delete --container-name pass-tfstate --account-name s105d01devstorage --account-key ${{secrets.ARM_ACCESS_KEY}} -n ${{steps.variables.outputs.pr_name}}.tfstate |