Skip to content

Commit

Permalink
Use list of available regions
Browse files Browse the repository at this point in the history
  • Loading branch information
robgutsopedra committed Mar 31, 2024
1 parent 13d4329 commit 4f97cfe
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/cron_deploy-from-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ env:
GCR_DEFAULT_REPO: ${{ vars.GCR_DEFAULT_REPO }}
GAR_DEFAULT_REPO: ${{ vars.GAR_DEFAULT_REPO }}
REGION: ${{ inputs.region }}
AVAILABLE_ZONES_FOR_DEPLOYMENT: ${{ vars.AVAILABLE_ZONES_FOR_DEPLOYMENT }}


jobs:
Expand All @@ -97,13 +98,16 @@ jobs:
echo "At least one of GCR_ENABLED or GAR_ENABLED must be set to true."
echo "At least one of GCR_ENABLED or GAR_ENABLED must be set to true." >> $GITHUB_STEP_SUMMARY
exit 1
- name: Region Validation
if: ${{ env.REGION != 'europe' && env.REGION != 'us-central1' }}
run: |
echo "Region must be either 'europe' or 'us-central1'."
echo "Region must be either 'europe' or 'us-central1'." >> $GITHUB_STEP_SUMMARY
exit 1
- name: Check if region is valid
run: |-
if [[ " ${AVAILABLE_ZONES_FOR_DEPLOYMENT[*]} " =~ ${{ env.REGION }} ]]; then
echo "This region - ${{ env.REGION }} - is allowed"
else
echo "Region - ${{ env.REGION }} - is not yet supported. Supported regions are: ${AVAILABLE_ZONES_FOR_DEPLOYMENT[*]}"
echo "::error::Region - ${{ env.REGION }} - is not yet supported. Supported regions are: ${AVAILABLE_ZONES_FOR_DEPLOYMENT[*]}"
exit 1
fi
- name: Checkout to selected branch
uses: actions/checkout@v4
Expand Down

0 comments on commit 4f97cfe

Please sign in to comment.