DZRobo commited on
Commit
a53096e
·
1 Parent(s): e109c36

Track image assets via LFS for HF mirror

Browse files

Adds a workflow step to track .jpg, .jpeg, and .png files with Git LFS and rewrites history for Hugging Face mirror compliance. This ensures binary assets are stored as LFS pointers in the HF mirror while preserving GitHub history.

Files changed (1) hide show
  1. .github/workflows/hf-mirror.yml +11 -0
.github/workflows/hf-mirror.yml CHANGED
@@ -32,6 +32,17 @@ jobs:
32
  git lfs checkout || true
33
  echo "LFS files present:" && git lfs ls-files || true
34
 
 
 
 
 
 
 
 
 
 
 
 
35
  - name: Push to HF mirror
36
  env:
37
  HF_USERNAME: ${{ secrets.HF_USERNAME }}
 
32
  git lfs checkout || true
33
  echo "LFS files present:" && git lfs ls-files || true
34
 
35
+ - name: Track image assets via LFS (mirror-only) and rewrite history
36
+ run: |
37
+ # Hugging Face requires binary assets (jpg/png) to be stored via LFS.
38
+ # We rewrite history locally on the runner so GitHub history remains intact,
39
+ # but the mirror on HF receives LFS pointers.
40
+ git lfs track "*.jpg" "*.jpeg" "*.png"
41
+ git add .gitattributes || true
42
+ git commit -m "ci(hf): track images via LFS (mirror-only)" || true
43
+ # Rewrite reachable history for these patterns
44
+ git lfs migrate import --yes --include="*.jpg,*.jpeg,*.png"
45
+
46
  - name: Push to HF mirror
47
  env:
48
  HF_USERNAME: ${{ secrets.HF_USERNAME }}