dev-scezui commited on
Commit
dd100ac
·
1 Parent(s): 15a7f68
Files changed (1) hide show
  1. .github/workflows/sync-to-hub.yml +21 -6
.github/workflows/sync-to-hub.yml CHANGED
@@ -17,9 +17,24 @@ jobs:
17
  fetch-depth: 0
18
  lfs: true
19
 
20
- - name: Push to Hugging Face Space
21
- uses: huggingface/huggingface-hub-action@main
22
- with:
23
- hf_token: ${{ secrets.HF_TOKEN }}
24
- repo_id: dev-scezui/tistru
25
- repo_type: space
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  fetch-depth: 0
18
  lfs: true
19
 
20
+ - name: Push to Hugging Face
21
+ env:
22
+ HF_TOKEN: ${{ secrets.HF_TOKEN }}
23
+ run: |
24
+ git remote add space https://.:$HF_TOKEN@huggingface.co/spaces/dev-scezui/tistru
25
+
26
+ # Retry up to 5 times with exponential backoff
27
+ for i in 1 2 3 4 5; do
28
+ echo "Attempt $i..."
29
+ git push --force space main && break
30
+ if [ $i -lt 5 ]; then
31
+ echo "Failed. Waiting $((i * 15)) seconds before retry..."
32
+ sleep $((i * 15))
33
+ fi
34
+ done
35
+
36
+ # Check if push ultimately succeeded
37
+ if ! git ls-remote space main &>/dev/null; then
38
+ echo "All retry attempts failed."
39
+ exit 1
40
+ fi