daniel-was-taken commited on
Commit
036f1e9
·
1 Parent(s): ba54252

Refactor Hugging Face sync workflow to remove LFS installation steps and clean up Git history

Browse files
Files changed (1) hide show
  1. .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
- # 1. Install LFS and track the extensions
25
- git lfs install
26
- git lfs track "*.pdf"
27
- git lfs track "*.docx"
28
- git lfs track "*.pptx"
29
- git lfs track "*.doc"
30
- git add .gitattributes
31
 
32
- # 2. The "Hard Reset" Strategy
33
- # We remove the files from Git's tracking and add them back
34
- # specifically as LFS pointers to ensure no binary data remains.
35
- git rm -r --cached .
36
- git add .
37
 
38
- # 3. Commit the "Clean" state
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