Skip to content

Schedule Scale Up Environments #188

Schedule Scale Up Environments

Schedule Scale Up Environments #188

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