Update Supabase project ID #69
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Post-deploy health check for Asper Beauty Shop (main project) | ||
|
Check failure on line 1 in .github/workflows/deploy-health-check.yml
|
||
| # Repo: asperpharma/understand-project | ||
| # Live: https://asperbeautyshop-com.lovable.app/ | ||
| # | ||
| # Runs on every push to main. Waits for Lovable to deploy, then pings the | ||
| # frontend health URL. Optional: post result to Discord. | ||
| # | ||
| # SETUP: Copy this file into your understand-project repo at | ||
| # .github/workflows/deploy-health-check.yml | ||
| # Optional: Add Discord webhook in GitHub repo Settings → Secrets → Actions: | ||
| # DISCORD_WEBHOOK_URL = https://discord.com/api/webhooks/... | ||
| # | ||
| name: Deploy health check | ||
| on: | ||
| push: | ||
| branches: [main] | ||
| jobs: | ||
| health-check: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Wait for Lovable deploy | ||
| run: | | ||
| echo "Lovable will deploy from this push. Waiting 120s for build to complete..." | ||
| sleep 120 | ||
| - name: Check frontend health | ||
| run: | | ||
| SITE_URL="${SITE_URL:-https://asperbeautyshop-com.lovable.app}" | ||
| HEALTH_URL="${SITE_URL%/}/health" | ||
| echo "Checking $HEALTH_URL" | ||
| HTTP_CODE=$(curl -s -o /dev/null -w '%{http_code}' --connect-timeout 10 "$HEALTH_URL" || true) | ||
| if [ "$HTTP_CODE" = "200" ]; then | ||
| echo "Health check OK (200)" | ||
| echo "HEALTH_OK=true" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "Health check returned HTTP $HTTP_CODE" | ||
| echo "HEALTH_OK=false" >> $GITHUB_OUTPUT | ||
| fi | ||
| id: health | ||
| env: | ||
| SITE_URL: https://asperbeautyshop-com.lovable.app | ||
| - name: Notify Discord (optional) | ||
| if: always() && secrets.DISCORD_WEBHOOK_URL != '' | ||
| env: | ||
| DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} | ||
| run: | | ||
| if [ -n "$DISCORD_WEBHOOK_URL" ]; then | ||
| STATUS="${{ steps.health.outputs.HEALTH_OK == 'true' && 'OK' || 'Check dashboard' }}" | ||
| COMMIT="${{ github.sha }}" | ||
| SHORT="${COMMIT:0:7}" | ||
| curl -s -X POST "$DISCORD_WEBHOOK_URL" \ | ||
| -H "Content-Type: application/json" \ | ||
| -d "{\"content\": \"Deploy health: **$STATUS** | Commit \`$SHORT\` | https://asperbeautyshop-com.lovable.app\"}" | ||
| fi | ||