HuggingFace Space keep-alive (backup) #76
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
| # ⚠️ BACKUP ONLY — GitHub Actions cron is unreliable for frequent pings | |
| # (runs get skipped during GH infra load or repo inactivity). | |
| # | |
| # PRIMARY keep-alive is UptimeRobot (free): | |
| # → https://uptimerobot.com | |
| # → Monitor type: HTTP(s) | |
| # → URL: https://rizzvision69-app-v2-space.hf.space/health | |
| # → Interval: every 5 minutes | |
| # → Alert contact: team.rizzvision@gmail.com | |
| # | |
| # Fallback option — cron-job.org (free): | |
| # → https://cron-job.org | |
| # → URL: https://rizzvision69-app-v2-space.hf.space/health | |
| # → Schedule: every 5 minutes | |
| # → Request method: GET | |
| name: HuggingFace Space keep-alive (backup) | |
| on: | |
| schedule: | |
| - cron: '*/5 * * * *' # best-effort — GH Actions does not guarantee this interval | |
| workflow_dispatch: # manual trigger from Actions tab | |
| jobs: | |
| ping: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Ping /health | |
| run: | | |
| URL="https://rizzvision69-app-v2-space.hf.space/health" | |
| STATUS=$(curl -s -o /tmp/body -w "%{http_code}" --max-time 30 "$URL") | |
| BODY=$(cat /tmp/body) | |
| echo "HTTP $STATUS — $BODY" | |
| if [ "$STATUS" = "200" ]; then | |
| echo "✓ Space is alive" | |
| else | |
| echo "⚠️ Space returned HTTP $STATUS — may be cold-starting, will retry next cycle" | |
| fi |