Spaces:
Runtime error
Runtime error
TONG commited on
Refactor Hugging Face sync workflow
Browse filesUpdated workflow to include full git history and LFS support.
.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] #
|
|
|
|
| 5 |
|
| 6 |
jobs:
|
| 7 |
-
sync:
|
| 8 |
runs-on: ubuntu-latest
|
| 9 |
steps:
|
| 10 |
-
-
|
| 11 |
-
|
| 12 |
with:
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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
|