Skip to content

Commit c261e15

Browse files
logic1
1 parent e403375 commit c261e15

File tree

2 files changed

+24
-8
lines changed

2 files changed

+24
-8
lines changed

.github/workflows/deploy.yml

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,26 @@ jobs:
3636
export AZURE_TENANT_ID=${{ secrets.AZURE_TENANT_ID }}
3737
export AZURE_CLIENT_SECRET=${{ secrets.AZURE_CLIENT_SECRET }}
3838
export AZURE_SUBSCRIPTION_ID="${{ secrets.AZURE_SUBSCRIPTION_ID }}"
39-
export GPT_MIN_CAPACITY="150"
39+
export GPT_MIN_CAPACITY="500"
4040
export AZURE_REGIONS="${{ vars.AZURE_REGIONS }}"
4141
4242
chmod +x infra/scripts/checkquota.sh
43-
if ! infra/scripts/checkquota.sh; then
44-
# If quota check fails due to insufficient quota, set the flag
45-
if grep -q "No region with sufficient quota found" infra/scripts/checkquota.sh; then
43+
44+
# Capture the script output for analysis
45+
QUOTA_OUTPUT=$(infra/scripts/checkquota.sh 2>&1)
46+
QUOTA_EXIT_CODE=$?
47+
48+
echo "$QUOTA_OUTPUT"
49+
50+
if [ $QUOTA_EXIT_CODE -ne 0 ]; then
51+
# Check if the failure is due to insufficient quota
52+
if echo "$QUOTA_OUTPUT" | grep -q "No region with sufficient quota found"; then
4653
echo "QUOTA_FAILED=true" >> $GITHUB_ENV
54+
exit 0 # Don't fail the pipeline yet, let the notification step handle it
55+
else
56+
echo "QUOTA_FAILED=false" >> $GITHUB_ENV
57+
exit 1 # Fail for other errors
4758
fi
48-
exit 1 # Fail the pipeline if any other failure occurs
4959
fi
5060
5161
- name: Send Notification on Quota Failure
@@ -69,8 +79,14 @@ jobs:
6979

7080
- name: Set Deployment Region
7181
run: |
72-
echo "Selected Region: $VALID_REGION"
73-
echo "AZURE_LOCATION=$VALID_REGION" >> $GITHUB_ENV
82+
if [ -n "$VALID_REGION" ]; then
83+
echo "Selected Region: $VALID_REGION"
84+
echo "AZURE_LOCATION=$VALID_REGION" >> $GITHUB_ENV
85+
else
86+
echo "⚠️ Warning: No valid region was set by quota check"
87+
# This step should not run if quota check failed, but adding safety check
88+
exit 1
89+
fi
7490
7591
- name: Setup Azure CLI
7692
run: |

infra/scripts/checkquota.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ done
8787
if [ -z "$VALID_REGION" ]; then
8888
echo "❌ No region with sufficient quota found. Blocking deployment."
8989
echo "QUOTA_FAILED=true" >> "$GITHUB_ENV"
90-
exit 0
90+
exit 1 # Exit with error code to indicate failure
9191
else
9292
echo "✅ Final Region: $VALID_REGION"
9393
echo "VALID_REGION=$VALID_REGION" >> "$GITHUB_ENV"

0 commit comments

Comments
 (0)