Spaces:
Runtime error
Runtime error
Download .github/workflows/keep-alive.yml from Talosware/talos-access: direct link, hf CLI and curl.
- Browser
- Download file 1.69 kB
-
https://huggingface.co/spaces/Talosware/talos-access/resolve/main/.github/workflows/keep-alive.yml
- Command line
-
hf download hf://spaces/Talosware/talos-access/.github/workflows/keep-alive.yml
-
curl -L -o keep-alive.yml https://huggingface.co/spaces/Talosware/talos-access/resolve/main/.github/workflows/keep-alive.yml
1.69 kB
| name: Keep Supabase + HF Space alive | |
| # Mantiene Supabase fuera del estado "Paused" (free tier pausa proyectos | |
| # tras 7 días sin actividad). Corre cada 3 días + se puede disparar manual. | |
| # | |
| # La estrategia: golpear el endpoint de login del HF Space, que internamente | |
| # consulta la tabla `users` de Supabase — eso cuenta como query activa. | |
| # | |
| # /health por sí solo NO sirve para keep-alive (no toca la BD), por eso | |
| # además hacemos un POST /api/v1/auth/login que sí la toca. | |
| on: | |
| schedule: | |
| # Cada 3 días a las 03:00 UTC (= 23:00 ART, 22:00 CLT) | |
| - cron: "0 3 */3 * *" | |
| workflow_dispatch: {} # permite trigger manual desde la UI de Actions | |
| jobs: | |
| ping: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Health check (Space alive) | |
| run: | | |
| STATUS=$(curl -s -o /dev/null -w "%{http_code}" \ | |
| https://talosware-talos-access.hf.space/health) | |
| echo "Health status: $STATUS" | |
| if [ "$STATUS" != "200" ]; then | |
| echo "::error::Health check failed with $STATUS" | |
| exit 1 | |
| fi | |
| - name: Login (forces Supabase query) | |
| run: | | |
| RESPONSE=$(curl -s -w "\n%{http_code}" \ | |
| -X POST https://talosware-talos-access.hf.space/api/v1/auth/login \ | |
| -H "Content-Type: application/json" \ | |
| -d '{"email":"admin@talos.com","password":"admin123"}') | |
| STATUS=$(echo "$RESPONSE" | tail -n1) | |
| echo "Login status: $STATUS" | |
| if [ "$STATUS" != "200" ]; then | |
| echo "::error::Login keep-alive failed with $STATUS" | |
| echo "$RESPONSE" | head -n1 | |
| exit 1 | |
| fi | |
| echo "Supabase touched OK (login returned 200)." | |