TONG commited on
Commit
8ac8ba2
·
unverified ·
1 Parent(s): 61af1de

Refactor Hugging Face sync workflow

Browse files

Updated workflow to include full git history and LFS support.

Files changed (1) hide show
  1. .github/workflows/sync-to-hf.yml +14 -7
.github/workflows/sync-to-hf.yml CHANGED
@@ -1,15 +1,22 @@
1
  name: Sync to Hugging Face Hub
2
  on:
3
  push:
4
- branches: [main] # Update this if your default branch is 'master'
 
5
 
6
  jobs:
7
- sync:
8
  runs-on: ubuntu-latest
9
  steps:
10
- - uses: actions/checkout@v6
11
- - uses: huggingface/hub-sync@v0.1.0
12
  with:
13
- github_repo_id: ${{ github.repository }}
14
- huggingface_repo_id: build-small-hackathon/step-zero
15
- hf_token: ${{ secrets.HF_TOKEN }}
 
 
 
 
 
 
 
1
  name: Sync to Hugging Face Hub
2
  on:
3
  push:
4
+ branches: [main] # Change to master if needed
5
+ workflow_dispatch:
6
 
7
  jobs:
8
+ sync-to-hub:
9
  runs-on: ubuntu-latest
10
  steps:
11
+ - name: Checkout Code with Full History
12
+ uses: actions/checkout@v4
13
  with:
14
+ fetch-depth: 0 # <-- CRUCIAL: Fetches ALL git history instead of just the latest commit
15
+ lfs: true # Includes Git LFS files if you have large model weights
16
+
17
+ - name: Push Git History to Hugging Face
18
+ env:
19
+ HF_TOKEN: ${{ secrets.HF_TOKEN }}
20
+ run: |
21
+ # Push the history using your token for authentication
22
+ git push --force https://build-small-hackathon:$HF_TOKEN@huggingface.co/spaces/build-small-hackathon/step-zero main