Skip to content

Merge pull request #114 from asperpharma/copilot/fix-typescript-compi… #374

Merge pull request #114 from asperpharma/copilot/fix-typescript-compi…

Merge pull request #114 from asperpharma/copilot/fix-typescript-compi… #374

# Post-deploy health check for Asper Beauty Shop (main project)
# 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()
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
- name: Notify Lovable webhook (if configured)
if: always()
env:
LOVABLE_WEBHOOK_URL: ${{ secrets.LOVABLE_WEBHOOK_URL }}
run: |
if [ -n "$LOVABLE_WEBHOOK_URL" ]; then
TIMESTAMP=$(date -u +%Y-%m-%dT%H:%M:%SZ)
curl -s -X POST "$LOVABLE_WEBHOOK_URL" \
-H "Content-Type: application/json" \
-d "{\"event\": \"sync\", \"timestamp\": \"$TIMESTAMP\", \"source\": \"github-action\"}"
fi