Spaces:
Running
Running
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
|
|
|
2 |
on:
|
3 |
push:
|
4 |
-
branches: [
|
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
|
22 |
-
|
23 |
-
- name:
|
|
|
|
|
|
|
|
|
|
|
24 |
env:
|
25 |
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
26 |
-
HF_USERNAME: ${{secrets.HF_USERNAME}}
|
27 |
-
run:
|
|
|
|
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
|