Spaces:
Running
Running
hf config
Browse files
.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 |
-
#
|
| 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 |
+
|