Essi commited on
Commit
e57ee60
Β·
1 Parent(s): 5af914e

perf: simplify sync_to_huggingface.yaml by using newly created GH Action

Browse files
.github/workflows/sync_to_huggingface.yaml CHANGED
@@ -5,36 +5,14 @@ on:
5
  branches: [main]
6
  workflow_dispatch:
7
 
8
- env:
9
- HF_USER: ealizadeh
10
- HF_REPO: ealizadeh/GAIA-Agent
11
-
12
  jobs:
13
  sync-to-hf-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/spaces/${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/spaces/${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/spaces/${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
 
5
  branches: [main]
6
  workflow_dispatch:
7
 
 
 
 
 
8
  jobs:
9
  sync-to-hf-hub:
10
  runs-on: ubuntu-latest
11
 
12
  steps:
13
+ - name: πŸ€— HF Space Sync
14
+ uses: e-alizadeh/gh-actions/hf-space-sync@main
15
  with:
16
+ hf_user: "ealizadeh"
17
+ hf_space: "GAIA-Agent"
18
+ hf_token: ${{ secrets.HF_TOKEN }}