Anshulprasad commited on
Commit
5e7bcfa
·
1 Parent(s): ba476cc

Add HF Space keepalive workflow

Browse files
.github/workflows/space-keepalive.yml ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Keep HF Space Awake
2
+
3
+ on:
4
+ schedule:
5
+ # First run at 02:00 UTC every other day
6
+ - cron: '0 2 */2 * *'
7
+ # Second run at 20:00 UTC on odd-numbered days
8
+ - cron: '0 20 1-31/2 * *'
9
+
10
+ workflow_dispatch: # allows manual run from Actions UI
11
+
12
+ jobs:
13
+ ping:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - name: Ping Space (retry)
17
+ run: |
18
+ for i in {1..3}; do
19
+ curl -fsS -o /dev/null -L 'https://huggingface.co/spaces/AnshulPrasad/Acharya_Prashant' && exit 0
20
+ sleep 30
21
+ done
22
+ echo "Ping failed" >&2
23
+ exit 1