Skip to content

HuggingFace Space keep-alive (backup) #76

HuggingFace Space keep-alive (backup)

HuggingFace Space keep-alive (backup) #76

Workflow file for this run

# ⚠️ 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