SCGR commited on
Commit
b7dba55
·
1 Parent(s): cd014bd
Files changed (1) hide show
  1. .github/workflows/sync-to-hub.yml +10 -1
.github/workflows/sync-to-hub.yml CHANGED
@@ -63,10 +63,19 @@ jobs:
63
  echo; echo "LFS objects present locally (should list your media):"
64
  git lfs ls-files || true
65
 
 
 
 
 
 
 
 
 
66
  - name: Push to HF Space
67
  run: |
68
  set -euo pipefail
69
  git remote remove space 2>/dev/null || true
70
  git remote add space https://huggingface.co/spaces/${HF_USERNAME}/${SPACE_NAME}.git
71
- # Force to ensure Space main matches GitHub main exactly
72
  git push space HEAD:main --force
 
 
63
  echo; echo "LFS objects present locally (should list your media):"
64
  git lfs ls-files || true
65
 
66
+ # Get all LFS files from GitHub before mirroring to the Space
67
+ - name: Fetch LFS objects from origin
68
+ run: |
69
+ git lfs fetch --all origin
70
+ git lfs checkout # materialize pointers -> files (optional but safe)
71
+ git lfs ls-files # show what LFS will upload
72
+
73
+ # Now upload LFS to the Space and push the refs
74
  - name: Push to HF Space
75
  run: |
76
  set -euo pipefail
77
  git remote remove space 2>/dev/null || true
78
  git remote add space https://huggingface.co/spaces/${HF_USERNAME}/${SPACE_NAME}.git
79
+ git lfs push --all space # upload all LFS objects to the Space remote
80
  git push space HEAD:main --force
81
+