Skip to content

Destroy Infra

Destroy Infra #3

Workflow file for this run

name: Destroy Infra
on:
workflow_call:
workflow_dispatch:
jobs:
terraform-destroy:
name: Destroy Infrastructure
defaults:
run:
working-directory: infra/
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node Key
run: |
echo "$(echo ${{secrets.NODE_KEY_64}} | base64 -d)" > modules/cluster/node_key && \
chmod 600 modules/cluster/node_key
- name: Sign in to AWS CLI
run: |
mkdir $HOME/.aws && \
echo [default] >> $HOME/.aws/credentials && \
echo aws_access_key_id = ${{secrets.AWS_ACCESS_KEY}} >> $HOME/.aws/credentials && \
echo aws_secret_access_key = ${{secrets.AWS_SECRET_KEY}} >> $HOME/.aws/credentials
- run: terraform init
- run: terraform destroy --auto-approve