vancauwe commited on
Commit
f94e137
·
1 Parent(s): 439ec7e

fix[action]: git lfs for png

Browse files
.github/workflows/push-to-hf-dev.yml CHANGED
@@ -1,8 +1,8 @@
1
- name: Sync to Hugging Face hub DEV
 
2
  on:
3
  push:
4
- branches: [dev]
5
- # to run this workflow manually from the Actions tab
6
  workflow_dispatch:
7
 
8
  jobs:
@@ -13,15 +13,27 @@ jobs:
13
  with:
14
  fetch-depth: 0
15
  lfs: true
 
 
 
 
 
 
16
  - name: Set up Git LFS
17
  run: |
18
  git lfs install
19
  git lfs track "*.png"
20
  git add .gitattributes
21
- git add src/images/design/challenge1.png src/images/design/challenge2.png src/images/design/leaderboard.png
22
- git commit -m "Track images with Git LFS" || echo "No changes to commit"
23
- - name: Push to DEV hub
 
 
 
 
 
24
  env:
25
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
26
- HF_USERNAME: ${{secrets.HF_USERNAME}}
27
- run: git push --force https://$HF_USERNAME:[email protected]/spaces/Saving-Willy/saving-willy-dev dev:main
 
 
1
+ name: Sync to Hugging Face hub
2
+
3
  on:
4
  push:
5
+ branches: [main]
 
6
  workflow_dispatch:
7
 
8
  jobs:
 
13
  with:
14
  fetch-depth: 0
15
  lfs: true
16
+
17
+ - name: Set Git identity
18
+ run: |
19
+ git config user.name "github-actions[bot]"
20
+ git config user.email "github-actions[bot]@users.noreply.github.com"
21
+
22
  - name: Set up Git LFS
23
  run: |
24
  git lfs install
25
  git lfs track "*.png"
26
  git add .gitattributes
27
+ git commit -m "Track PNGs with Git LFS" || echo "No changes to commit"
28
+
29
+ - name: Migrate existing PNGs to LFS
30
+ run: |
31
+ git lfs migrate import --include="src/images/design/*.png"
32
+ git commit -m "Migrate PNG images to LFS" || echo "No changes to commit"
33
+
34
+ - name: Push to Hugging Face
35
  env:
36
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
37
+ HF_USERNAME: ${{ secrets.HF_USERNAME }}
38
+ run: |
39
+ git push --force https://$HF_USERNAME:[email protected]/spaces/Saving-Willy/saving-willy-space main