Remove Infrastructure #8
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 Infrastructure | |
on: | |
workflow_dispatch: # Allows you to run this workflow manually from the Actions tab | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
remove-resources-group: | |
name: Remove Infrastructure | |
runs-on: ubuntu-latest | |
steps: | |
- name: Azure login | |
uses: azure/login@v1 | |
with: | |
client-id: ${{ secrets.AZURE_CLIENT_ID }} | |
tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
- name: Setup Terraform | |
uses: hashicorp/setup-terraform@v3 | |
- name: Terraform destroy | |
run: terraform destroy | |
- name: Delete images resource group | |
uses: azure/CLI@v1 | |
with: | |
azcliversion: latest | |
inlineScript: | | |
az group delete --name packer-images-rg --yes | |
- name: Delete build resource group | |
uses: azure/CLI@v1 | |
with: | |
azcliversion: latest | |
inlineScript: | | |
az group delete --name packer-build-rg --yes |