Skip to content

Terraform Destroy

Terraform Destroy #10

Workflow file for this run

name: Terraform Destroy
on:
workflow_dispatch:
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_BASE_REGION }}
TFSTATE_BUCKET: ${{ secrets.TFSTATE_BUCKET }}
TFSTATE_KEY: ${{ secrets.TFSTATE_KEY }}
GRAFANA_ADMIN_PASSWORD: ${{ secrets.GRAFANA_ADMIN_PASSWORD }}
CLOUDFLARE_ZONE_ID: ${{ secrets.CLOUDFLARE_ZONE_ID }}
CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }}
CLOUDFLARE_EMAIL: ${{ secrets.CLOUDFLARE_EMAIL }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
TAILSCALE_CLIENT_ID: ${{ secrets.TAILSCALE_CLIENT_ID }}
TAILSCALE_CLIENT_SECRET: ${{ secrets.TAILSCALE_CLIENT_SECRET }}
CROWDSEC_ENROLL_KEY: ${{ secrets.CROWDSEC_ENROLL_KEY }}
jobs:
terraform-destroy:
runs-on: ubuntu-latest
name: Terraform Destroy
defaults:
run:
working-directory: ./terraform
steps:
- name: Checkout
uses: actions/checkout@v4
# - name: Determine Deployment Stage
# id: determine_stage
# run: |
# if [[ "${{ github.ref_name }}" == "main" ]]; then
# echo "stage=prod" >> $GITHUB_ENV
# else
# echo "stage=dev" >> $GITHUB_ENV
# fi
- name: Terraform Destroy
id: terraform-destroy
uses: ./.github/actions/terraform-destroy
with:
aws-access-key-id: ${{ env.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ env.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
tfstate-bucket: ${{ env.TFSTATE_BUCKET }}
tfstate-key: ${{ env.TFSTATE_KEY }}
stage: "prod"
GRAFANA_ADMIN_PASSWORD: ${{ env.GRAFANA_ADMIN_PASSWORD }}
CLOUDFLARE_ZONE_ID: ${{ env.CLOUDFLARE_ZONE_ID }}
CLOUDFLARE_TOKEN: ${{ env.CLOUDFLARE_TOKEN }}
CLOUDFLARE_EMAIL: ${{ env.CLOUDFLARE_EMAIL }}
CLOUDFLARE_API_TOKEN: ${{ env.CLOUDFLARE_API_TOKEN }}
SLACK_WEBHOOK: ${{ env.SLACK_WEBHOOK }}
TAILSCALE_CLIENT_ID: ${{ env.TAILSCALE_CLIENT_ID }}
TAILSCALE_CLIENT_SECRET: ${{ env.TAILSCALE_CLIENT_SECRET }}
CROWDSEC_ENROLL_KEY: ${{ env.CROWDSEC_ENROLL_KEY }}