Lenson commited on
Commit
683941c
·
1 Parent(s): 1f4967a

Add keep-alive: use HF token auth, /health endpoint, every 12h

Browse files
Files changed (1) hide show
  1. .github/workflows/keep-alive.yml +24 -0
.github/workflows/keep-alive.yml ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Keep HF Spaces Alive
2
+
3
+ on:
4
+ schedule:
5
+ - cron: '0 */12 * * *'
6
+ workflow_dispatch:
7
+
8
+ jobs:
9
+ ping:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - name: Ping nanobot
13
+ run: |
14
+ response=$(curl -s -H "Authorization: Bearer ${{ secrets.HF_TOKEN }}" \
15
+ "https://lenson78-nanobot.hf.space/health")
16
+ echo "nanobot: $response"
17
+ echo "$response" | grep -q "OK" && echo "nanobot OK" || echo "nanobot FAILED"
18
+
19
+ - name: Ping codex-proxy
20
+ run: |
21
+ response=$(curl -s -H "Authorization: Bearer ${{ secrets.HF_TOKEN }}" \
22
+ "https://lenson78-codex-proxy.hf.space/health")
23
+ echo "codex-proxy: $response"
24
+ echo "$response" | grep -q "ok" && echo "codex-proxy OK" || echo "codex-proxy FAILED"