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
|
shell: sh
|
||||||
run: |
|
run: |
|
||||||
echo "Waiting for service to be ready"
|
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
|
||||||
|
|
||||||
if [ "$HTTP_CODE" = "200" ]; then
|
while [ "$ATTEMPT" -le "$MAX_ATTEMPTS" ]; do
|
||||||
echo "Health check passed (HTTP $HTTP_CODE)"
|
HTTP_CODE=$(curl -k -sS -o /dev/null -w "%{http_code}" --max-time 30 https://qr.crewsportswear.app/health || true)
|
||||||
else
|
|
||||||
echo "Health check failed (HTTP $HTTP_CODE)"
|
if [ -z "$HTTP_CODE" ]; then
|
||||||
exit 1
|
HTTP_CODE="000"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$HTTP_CODE" = "200" ]; then
|
||||||
|
echo "Health check passed (HTTP $HTTP_CODE)"
|
||||||
|
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
|
||||||
@@ -68,4 +68,5 @@ Notes:
|
|||||||
|
|
||||||
- Uses external Docker networks: `traefik-public` and `crew-app-net`
|
- Uses external Docker networks: `traefik-public` and `crew-app-net`
|
||||||
- Internal service port is `3000`
|
- Internal service port is `3000`
|
||||||
|
- TLS uses Traefik Let's Encrypt via `tls.certresolver=le`
|
||||||
- Includes HTTP -> HTTPS redirect via Traefik labels
|
- Includes HTTP -> HTTPS redirect via Traefik labels
|
||||||
|
|||||||
Reference in New Issue
Block a user