Destroy Infra #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |