-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (35 loc) · 1.3 KB
/
hf-keepalive.yml
File metadata and controls
38 lines (35 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# ⚠️ 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