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

This commit is contained in:
Frank John Begornia
2026-04-02 15:35:18 +08:00
parent 2c367fd6f8
commit 5e8d5fb42e
2 changed files with 22 additions and 8 deletions

View File

@@ -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
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 if [ "$HTTP_CODE" = "200" ]; then
echo "Health check passed (HTTP $HTTP_CODE)" echo "Health check passed (HTTP $HTTP_CODE)"
else exit 0
echo "Health check failed (HTTP $HTTP_CODE)"
exit 1
fi 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

View File

@@ -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