diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index b0f31f78..bdd8141c 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -490,25 +490,28 @@ jobs: DEPLOY_URL: ${{ needs.prepare.outputs.next_public_url }} GK_PASS: ${{ secrets.GATEKEEPER_PASSWORD || 'klz2026' }} run: | - echo "Waiting 10s for app to fully start..." - sleep 10 + echo "Waiting 30s for app to fully start (cold start / migrations)..." + sleep 30 + echo "Checking basic health..." - curl -sf "$DEPLOY_URL/health" || { echo "❌ Basic health check failed"; exit 1; } + curl -sfL --retry 3 --retry-delay 5 "$DEPLOY_URL/health" || { echo "❌ Basic health check failed after retries"; exit 1; } echo "✅ Basic health OK" + echo "Checking CMS DB connectivity..." - RESPONSE_HEADERS=$(curl -sfI "$DEPLOY_URL/api/health/cms?gk_bypass=$GK_PASS&cb=$(date +%s)" 2>&1) - RESPONSE=$(curl -sf "$DEPLOY_URL/api/health/cms?gk_bypass=$GK_PASS&cb=$(date +%s)" 2>&1) || { + # We use -v to see if we hit Gatekeeper (307) or 503/504 + URL="$DEPLOY_URL/api/health/cms?gk_bypass=$GK_PASS&cb=$(date +%s)" + RESPONSE=$(curl -sfL --retry 3 --retry-delay 5 "$URL" 2>&1) || { echo "❌ CMS health check failed!" - echo "--- RESPONSE HEADERS ---" - curl -sI "$DEPLOY_URL/api/health/cms?gk_bypass=$GK_PASS&cb=$(date +%s)" + echo "--- DEBUG INFO ---" + curl -svI "$URL" echo "--- RESPONSE BODY ---" - echo "$RESPONSE" + curl -sL "$URL" echo "" echo "This usually means Payload CMS migrations failed or DB tables are missing." - echo "Check: docker logs \$APP_CONTAINER | grep -i error" exit 1 } echo "✅ CMS health: $RESPONSE" + - name: 🚀 OG Image Check if: always() && steps.deps.outcome == 'success' env: