Spaces:
Sleeping
Sleeping
Essi
commited on
Commit
Β·
24296e4
1
Parent(s):
b009775
feat: :sparkles: add GitHub Actions workflow for syncing to HuggingFace hub
Browse files
.github/workflow/sync_to_huggingface.yaml
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: Sync to HuggingFace π€ hub
|
2 |
+
|
3 |
+
on:
|
4 |
+
push:
|
5 |
+
branches: [main]
|
6 |
+
workflow_dispatch:
|
7 |
+
|
8 |
+
env:
|
9 |
+
HF_USER: ealizadeh
|
10 |
+
HF_REPO: ${HF_USER}/gaia-agent
|
11 |
+
|
12 |
+
jobs:
|
13 |
+
sync-to-hub:
|
14 |
+
runs-on: ubuntu-latest
|
15 |
+
|
16 |
+
steps:
|
17 |
+
- name: Check out repository
|
18 |
+
uses: actions/checkout@v4
|
19 |
+
with:
|
20 |
+
fetch-depth: 0
|
21 |
+
lfs: true
|
22 |
+
|
23 |
+
- name: Verify π€ HF repo exists
|
24 |
+
run: |
|
25 |
+
if git ls-remote "https://huggingface.co/${HF_REPO}.git" &> /dev/null; then
|
26 |
+
echo "β
HF repo found: ${HF_REPO}"
|
27 |
+
else
|
28 |
+
echo "β HF repo not found at https://huggingface.co/${HF_REPO}.git" && exit 1
|
29 |
+
fi
|
30 |
+
|
31 |
+
- name: Push to HF repo π€
|
32 |
+
env:
|
33 |
+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
34 |
+
run: |
|
35 |
+
echo "β Pushing local 'main' β HF '${HF_REPO}' (force)"
|
36 |
+
if git push -f "https://${HF_USER}:$HF_TOKEN@huggingface.co/${HF_REPO}.git" main; then
|
37 |
+
echo "β
Push succeeded."
|
38 |
+
else
|
39 |
+
echo "β Push failed. Double-check 'HF_TOKEN' and permissions." && exit 1
|
40 |
+
fi
|