Spaces:
Running
Running
Commit ·
dd100ac
1
Parent(s): 15a7f68
try2
Browse files
.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
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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
|