Cleanup CI test environments #211
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: Cleanup CI test environments | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * 1-5" | |
env: | |
AWS_REGION: "eu-west-2" | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
cleanup: | |
name: Cleanup test environments | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup-terraform | |
- uses: ./.github/actions/setup-zsh | |
- name: Configure AWS credentials for tools account | |
uses: ./.github/actions/configure-aws-credentials | |
with: | |
aws-region: ${{ env.AWS_REGION }} | |
tools-account-role: ${{ secrets.UHD_TERRAFORM_IAM_ROLE }} | |
# Timeout after 6 hours | |
role-duration-seconds: "21600" | |
- name: Terraform cleanup | |
run: | | |
source uhd.sh | |
uhd terraform init | |
uhd terraform cleanup | |
shell: zsh {0} |