fix: Aumenta o número de tentativas e reduz os intervalos de espera para a verificação de status do deploy no workflow.

This commit is contained in:
Rodrigo Borba 2026-01-25 14:17:08 -03:00
parent 16b3703c0a
commit a7bf570815

View File

@ -20,11 +20,10 @@ jobs:
run: echo "https://chatwoot-pr-${{ github.event.pull_request.number }}.herokuapp.com" run: echo "https://chatwoot-pr-${{ github.event.pull_request.number }}.herokuapp.com"
- name: Check Deployment Status - name: Check Deployment Status
run: | run: |
max_attempts=10 max_attempts=15
attempt=1 attempt=1
status_code=0 status_code=0
echo "Waiting for review app to be deployed/redeployed, trying in 10 minutes..." echo "Checking review app status..."
sleep 600
while [ $attempt -le $max_attempts ]; do while [ $attempt -le $max_attempts ]; do
response=$(curl -s -o /dev/null -w "%{http_code}" https://chatwoot-pr-${{ github.event.pull_request.number }}.herokuapp.com/api) response=$(curl -s -o /dev/null -w "%{http_code}" https://chatwoot-pr-${{ github.event.pull_request.number }}.herokuapp.com/api)
status_code=$(echo $response | head -n 1) status_code=$(echo $response | head -n 1)
@ -34,15 +33,15 @@ jobs:
echo "Deployment successful" echo "Deployment successful"
exit 0 exit 0
else else
echo "Deployment status unknown, retrying in 3 minutes..." echo "Deployment status healthy but services not ready, retrying in 30 seconds..."
sleep 180 sleep 30
fi fi
else else
echo "Waiting for review app to be ready, retrying in 3 minutes..." echo "Waiting for review app to be ready, retrying in 30 seconds... (Attempt $attempt/$max_attempts)"
sleep 180 sleep 30
attempt=$((attempt + 1)) attempt=$((attempt + 1))
fi fi
done done
echo "Deployment failed after $max_attempts attempts" echo "Deployment check timed out after $max_attempts attempts"
exit 1 exit 1
fi fi