-
Notifications
You must be signed in to change notification settings - Fork 14
43 lines (35 loc) · 1.18 KB
/
terraform-qa-only-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
32
33
34
35
36
37
38
39
40
41
42
43
name: 'Terraform-QA-Only-Destroy'
on:
workflow_dispatch:
jobs:
terraform:
name: 'Terraform QA Only Destroy'
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Terraform
uses: hashicorp/setup-terraform@v1
with:
terraform_version: 0.13.5
- name: Terraform Init
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: terraform init
working-directory: tf
- name: Terraforrm Workspace
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: terraform workspace select `echo ${GITHUB_REF} | sed 's/\//-/g'` || terraform workspace new `echo ${GITHUB_REF} | sed 's/\//-/g'`
working-directory: tf
- name: Terraform Destroy
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: terraform destroy -auto-approve -var-file ../envs/qa.tfvars
working-directory: tf