Delete old cloudformation stacks #406
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: "Delete old cloudformation stacks" | |
# Controls when the action will run - in this case triggered manually and on schedule | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 1,13 * * *" | |
jobs: | |
delete-old-cloudformation-stacks: | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- name: Checkout local code | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ env.BRANCH_NAME }} | |
fetch-depth: 0 | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-region: eu-west-2 | |
role-to-assume: ${{ secrets.DEV_CLOUD_FORMATION_DEPLOY_ROLE }} | |
role-session-name: delete-old-stacks | |
- name: delete stacks | |
shell: bash | |
working-directory: .github/scripts | |
run: ./delete_stacks.sh | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
delete-old-proxygen-deployments: | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- name: Checkout local code | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ env.BRANCH_NAME }} | |
fetch-depth: 0 | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-region: eu-west-2 | |
role-to-assume: ${{ secrets.PROXYGEN_PTL_ROLE }} | |
role-session-name: delete-old-proxygen | |
- name: delete proxygen deployments | |
shell: bash | |
working-directory: .github/scripts | |
run: ./delete_proxygen_deployments.sh |