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