-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NIT-1305 adding a reusable workflow for scaling up
- Loading branch information
1 parent
9264382
commit a19a1c9
Showing
2 changed files
with
37 additions
and
39 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Schedule Scale Up Environments | ||
|
||
on: | ||
schedule: | ||
- cron: '0 6 * * 1-5' # Schedule for POC environment | ||
- cron: '0 3 * * 1-5' # Schedule for DEV environment | ||
|
||
jobs: | ||
scale-up: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
environment: ["poc", "dev"] | ||
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 | ||
- name: Call scale up workflow | ||
if: env.ENV_TO_SCALE != 'NONE' | ||
uses: ./.github/workflows/scale-up.yml | ||
with: | ||
environment: ${{ env.ENV_TO_SCALE }} |