-
Notifications
You must be signed in to change notification settings - Fork 0
31 lines (23 loc) · 1.07 KB
/
destroy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
name: Terraform Destroy
on: [workflow_dispatch]
jobs:
destroy-terraform:
name: 'Destroy terraform infra'
runs-on: ubuntu-latest
environment: development
env:
ARM_CLIENT_ID: ${{secrets.ARM_CLIENT_ID}}
ARM_CLIENT_SECRET: ${{secrets.ARM_CLIENT_SECRET}}
ARM_SUBSCRIPTION_ID: ${{secrets.ARM_SUBSCRIPTION_ID}}
ARM_TENANT_ID: ${{secrets.ARM_TENANT_ID}}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Terraform
uses: hashicorp/setup-terraform@v1
- name: Terraform Init
run: terraform init -backend-config="resource_group_name=${{ secrets.TF_BACKEND_CONFIG_RG_NAME }}" -backend-config="storage_account_name=${{ secrets.TF_BACKEND_CONFIG_SA_NAME }}" -backend-config="container_name=${{ secrets.TF_BACKEND_CONFIG_CONTAINER_NAME }}" -backend-config="key=${{ secrets.TF_BACKEND_CONFIG_FILE_KEY }}"
- name: Terraform Plan
run: terraform plan -var-file=./environments/dev/dev.tfvars
- name: Terraform Destroy
run: terraform destroy -var-file=./environments/dev/dev.tfvars -auto-approve