Spaces:
Runtime error
Runtime error
Commit ·
036f1e9
1
Parent(s): ba54252
Refactor Hugging Face sync workflow to remove LFS installation steps and clean up Git history
Browse files- .github/workflows/main.yml +8 -17
.github/workflows/main.yml
CHANGED
|
@@ -21,24 +21,15 @@ jobs:
|
|
| 21 |
git config --global user.email "actions@github.com"
|
| 22 |
git config --global user.name "GitHub Actions"
|
| 23 |
|
| 24 |
-
#
|
| 25 |
-
git
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
git lfs track "*.pptx"
|
| 29 |
-
git lfs track "*.doc"
|
| 30 |
-
git add .gitattributes
|
| 31 |
|
| 32 |
-
#
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
git rm -r --cached .
|
| 36 |
-
git add .
|
| 37 |
|
| 38 |
-
#
|
| 39 |
-
git commit -m "ci: force lfs migration for all binaries" || true
|
| 40 |
-
|
| 41 |
-
# 4. Push with the --force flag to overwrite the remote history
|
| 42 |
-
# This clears out the "binary blobs" Hugging Face is complaining about.
|
| 43 |
git remote add hf https://daniel-was-taken:$HF_TOKEN@huggingface.co/spaces/daniel-was-taken/CompifAI
|
| 44 |
git push hf main --force
|
|
|
|
| 21 |
git config --global user.email "actions@github.com"
|
| 22 |
git config --global user.name "GitHub Actions"
|
| 23 |
|
| 24 |
+
# Remove data/ directory from entire Git history
|
| 25 |
+
git filter-branch --force --index-filter \
|
| 26 |
+
'git rm -r --cached --ignore-unmatch data/' \
|
| 27 |
+
--prune-empty --tag-name-filter cat -- --all
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
+
# Force garbage collection to clean up
|
| 30 |
+
git reflog expire --expire=now --all
|
| 31 |
+
git gc --prune=now --aggressive
|
|
|
|
|
|
|
| 32 |
|
| 33 |
+
# Add Hugging Face remote and force push clean history
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
git remote add hf https://daniel-was-taken:$HF_TOKEN@huggingface.co/spaces/daniel-was-taken/CompifAI
|
| 35 |
git push hf main --force
|