Z-CRON: Tear down - Sandboxes #304
This file contains hidden or 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: 'Z-CRON: Tear down - Sandboxes' | |
| on: | |
| schedule: | |
| - cron: 59 18-21 * * 1-5 # utc time | |
| permissions: | |
| pull-requests: write | |
| id-token: write # This is required for requesting the JWT | |
| contents: read # This is required for actions/checkout | |
| jobs: | |
| destroy_process: | |
| name: Destroy Sandboxes | |
| runs-on: ubuntu-latest | |
| environment: development | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: main | |
| - name: Configure AWS Credentials | |
| uses: aws-actions/configure-aws-credentials@v5 | |
| with: | |
| role-to-assume: ${{ secrets.AWS_ASSUME_ROLE }} | |
| role-skip-session-tagging: true | |
| aws-region: ${{ vars.AWS_REGION }} | |
| mask-aws-account-id: true | |
| - name: Setup Python 3.11 | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: 3.11 | |
| - name: Install Python Dependencies | |
| run: | | |
| python3 -m venv ./venv | |
| ./venv/bin/pip3 install --upgrade pip boto3 requests | |
| - name: Run Sandbox Cleanup Script | |
| run: ./venv/bin/python3 -u scripts/cleanup_sandboxes.py | |
| env: | |
| GIT_WORKFLOW_PAT: ${{ secrets.GIT_WORKFLOW_PAT }} # See https://docs.github.com/en/rest/actions/workflows?apiVersion=2022-11-28#create-a-workflow-dispatch-event |