Enhance health check logic in deployment workflow and update README with TLS information
All checks were successful
Deploy Production (qr.crewsportswear.app) / deploy (push) Successful in 34s
All checks were successful
Deploy Production (qr.crewsportswear.app) / deploy (push) Successful in 34s
This commit is contained in:
@@ -107,13 +107,26 @@ jobs:
|
||||
shell: sh
|
||||
run: |
|
||||
echo "Waiting for service to be ready"
|
||||
sleep 15
|
||||
|
||||
HTTP_CODE=$(curl -k -s -o /dev/null -w "%{http_code}" --max-time 30 https://qr.crewsportswear.app/health || echo "000")
|
||||
MAX_ATTEMPTS=12
|
||||
ATTEMPT=1
|
||||
|
||||
while [ "$ATTEMPT" -le "$MAX_ATTEMPTS" ]; do
|
||||
HTTP_CODE=$(curl -k -sS -o /dev/null -w "%{http_code}" --max-time 30 https://qr.crewsportswear.app/health || true)
|
||||
|
||||
if [ -z "$HTTP_CODE" ]; then
|
||||
HTTP_CODE="000"
|
||||
fi
|
||||
|
||||
if [ "$HTTP_CODE" = "200" ]; then
|
||||
echo "Health check passed (HTTP $HTTP_CODE)"
|
||||
else
|
||||
echo "Health check failed (HTTP $HTTP_CODE)"
|
||||
exit 1
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Attempt $ATTEMPT/$MAX_ATTEMPTS: health check not ready yet (HTTP $HTTP_CODE)"
|
||||
ATTEMPT=$((ATTEMPT + 1))
|
||||
sleep 10
|
||||
done
|
||||
|
||||
echo "Health check failed after $MAX_ATTEMPTS attempts"
|
||||
exit 1
|
||||
Reference in New Issue
Block a user