exportstatement / .github /workflows /keep-alive.yml
Rudra
ci: ping HF Space every 6h so it never sleeps
a1c62b2
Raw History Blame Contribute Delete
773 Bytes
# Keeps the Hugging Face Space awake — HF free Spaces sleep after ~48h idle,
# and any HTTP request resets that timer. Runs on GitHub's infra (not a laptop).
name: Keep HF Space awake
on:
schedule:
- cron: "0 */6 * * *" # every 6 hours (well under the 48h sleep window)
workflow_dispatch: # lets you run it manually from the Actions tab
jobs:
ping:
runs-on: ubuntu-latest
steps:
- name: Ping extractor /health
run: |
URL="https://optionalrudra-exportstatement.hf.space/health"
# --max-time 90 tolerates a cold start if it ever did nod off
code=$(curl -s -o /tmp/h.json -w "%{http_code}" --max-time 90 "$URL")
echo "health: $code"; cat /tmp/h.json || true
test "$code" = "200"