From a4f0cdd9b3fba99ba23cd20da1d5930cedcfc228 Mon Sep 17 00:00:00 2001 From: jaezeu Date: Thu, 27 Jun 2024 20:58:21 +0800 Subject: [PATCH] Destroy pipeline --- .github/workflows/destroy.yaml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 .github/workflows/destroy.yaml diff --git a/.github/workflows/destroy.yaml b/.github/workflows/destroy.yaml new file mode 100755 index 0000000..ce5f62a --- /dev/null +++ b/.github/workflows/destroy.yaml @@ -0,0 +1,32 @@ +name: Terraform Destroy + +on: workflow_dispatch + +env: + AWS_REGION: ap-southeast-1 + +jobs: + Destroy: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ env.AWS_REGION }} + + - name: Setup Terraform + uses: hashicorp/setup-terraform@v2 + with: + terraform_wrapper: false + + - name: Terraform Init + run: terraform init + + - name: Terraform Destroy + run: terraform destroy -auto-approve \ No newline at end of file