GitHub Environment Cleanup #21
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: GitHub Environment Cleanup | |
on: | |
schedule: | |
- cron: 0 0 * * 1-5 | |
jobs: | |
deploy: | |
name: Clean Up Environments | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@cd7d8d697e10461458bc61a30d094dc601a8b017 | |
with: | |
fetch-depth: 0 | |
- name: Install dependencies | |
uses: ./.github/workflows/install | |
timeout-minutes: 30 | |
with: | |
key: ${{ hashFiles('yarn.lock') }} | |
yarn_cache_folder: .cache/yarn | |
path: | | |
.cache/yarn | |
node_modules | |
- name: Configure AWS credentials | |
uses: ./.github/workflows/configure-aws-credentials | |
with: | |
aws_id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws_region: us-gov-west-1 | |
- name: Get va-vsp-bot token | |
uses: ./.github/workflows/inject-secrets | |
with: | |
ssm_parameter: /devops/VA_VSP_BOT_GITHUB_TOKEN | |
env_variable_name: VA_VSP_BOT_GITHUB_TOKEN | |
- name: Clean up Environments | |
if: ${{ always() }} | |
run: node script/github-actions/gh-env-cleanup.js | |
env: | |
GITHUB_TOKEN: ${{ env.VA_VSP_BOT_GITHUB_TOKEN }} |