Schedule Scale Up Environments #245
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: Schedule Scale Up Environments | |
on: | |
schedule: | |
- cron: '0 6 * * 1-5' # Scale up POC environment at 6am on weekdays | |
- cron: '0 3 * * 1-5' # Scale up DEV environment at 3am on weekdays | |
jobs: | |
scale-up: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
environment: ["poc"] | |
steps: | |
- name: Determine Environment | |
id: which-env | |
run: | | |
if [[ "0 6 * * 1-5" == "${{ github.event.schedule }}" && "${{ matrix.environment }}" == "poc" ]]; then | |
echo "ENV_TO_SCALE=poc" >> $GITHUB_ENV | |
elif [[ "0 3 * * 1-5" == "${{ github.event.schedule }}" && "${{ matrix.environment }}" == "dev" ]]; then | |
echo "ENV_TO_SCALE=dev" >> $GITHUB_ENV | |
else | |
echo "ENV_TO_SCALE=NONE" >> $GITHUB_ENV | |
fi | |
- name: Call scale up workflow | |
if: env.ENV_TO_SCALE != 'NONE' | |
uses: ./.github/workflows/scale-up.yaml | |
with: | |
environment: ${{ env.ENV_TO_SCALE }}-preapproved |