Stack Destroy #15
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: Stack Destroy | |
on: | |
workflow_dispatch: | |
permissions: | |
id-token: write # This is required for requesting the JWT | |
contents: read # This is required for actions/checkout | |
jobs: | |
destory: | |
name: Destroy | |
runs-on: ubuntu-latest | |
env: | |
AWS_REGION: ${{ secrets.AWS_REGION }} | |
steps: | |
- name: Git clone the repository | |
uses: actions/checkout@v3 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v2 | |
with: | |
role-to-assume: ${{ secrets.AWS_CDK_ROLE_ARN }} | |
role-session-name: docs-site-template-destroy | |
aws-region: ${{ env.AWS_REGION }} | |
- name: Setup Node.js environment | |
uses: actions/[email protected] | |
with: | |
node-version: lts/* | |
- name: Installing dependencies | |
working-directory: cdk | |
run: npm install | |
- name: Destroying | |
working-directory: cdk | |
run: npm run destroy -- --force | |
- name: Clean dynamic variables | |
env: | |
GH_TOKEN: ${{ secrets.GH_SECRETS_TOKEN }} | |
run: | | |
gh variable delete AWS_BUCKET_NAME --env aws-development | |
gh variable delete AWS_DISTRIBUTION_ID --env aws-development | |
gh variable delete AWS_WEBSITE_URL --env aws-development |