Skip to content

Cleanup CI test environments #218

Cleanup CI test environments

Cleanup CI test environments #218

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}