Skip to content

Commit

Permalink
add Terraform destroy jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
nkordis committed May 26, 2024
1 parent 1199d55 commit 01453ff
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/destroy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Destroy

on:
workflow_dispatch:
inputs:
enviroment:
type: choice
description: Which enviroment to remove AWS resources for?
options:
- staging
- prod

jobs:
destroy:
name: Destroy
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Terraform Destroy
env:
AWS_ACCESS_KEY_ID: ${{ vars.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
export TF_WORKSPACE=${{ github.event.inputs.enviroment }}
cd infra/
docker compose run --rm terraform -chdir=deploy/ init
docker compose run --rm terraform -chdir=deploy/ destroy -auto-approve

0 comments on commit 01453ff

Please sign in to comment.