MaxHuber888 commited on
Added file check action
Browse files- .github/workflows/main.yml +25 -3
.github/workflows/main.yml
CHANGED
|
@@ -1,20 +1,42 @@
|
|
| 1 |
-
name: Sync to Hugging Face hub
|
|
|
|
| 2 |
on:
|
| 3 |
push:
|
| 4 |
branches: [main]
|
| 5 |
|
| 6 |
-
|
|
|
|
|
|
|
| 7 |
workflow_dispatch:
|
| 8 |
|
| 9 |
jobs:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
sync-to-hub:
|
|
|
|
|
|
|
| 11 |
runs-on: ubuntu-latest
|
|
|
|
| 12 |
steps:
|
| 13 |
- uses: actions/checkout@v3
|
| 14 |
with:
|
| 15 |
fetch-depth: 0
|
| 16 |
lfs: true
|
|
|
|
| 17 |
- name: Push to hub
|
| 18 |
env:
|
| 19 |
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
| 20 |
-
run: git push https://maxhuber:$HF_TOKEN@huggingface.co/spaces/maxhuber/deepsquid main
|
|
|
|
| 1 |
+
name: Check file size and Sync to Hugging Face hub
|
| 2 |
+
|
| 3 |
on:
|
| 4 |
push:
|
| 5 |
branches: [main]
|
| 6 |
|
| 7 |
+
pull_request:
|
| 8 |
+
branches: [main]
|
| 9 |
+
|
| 10 |
workflow_dispatch:
|
| 11 |
|
| 12 |
jobs:
|
| 13 |
+
check-file-size:
|
| 14 |
+
runs-on: ubuntu-latest
|
| 15 |
+
|
| 16 |
+
steps:
|
| 17 |
+
- uses: actions/checkout@v3
|
| 18 |
+
with:
|
| 19 |
+
fetch-depth: 0
|
| 20 |
+
lfs: true
|
| 21 |
+
|
| 22 |
+
- name: Check large files
|
| 23 |
+
id: check_large_files
|
| 24 |
+
uses: ActionsDesk/lfs-warning@v2.0
|
| 25 |
+
with:
|
| 26 |
+
filesizelimit: 10485760 # 10MB
|
| 27 |
+
|
| 28 |
sync-to-hub:
|
| 29 |
+
needs: check-file-size
|
| 30 |
+
if: steps.check_large_files.outputs.filesizelimit == '0'
|
| 31 |
runs-on: ubuntu-latest
|
| 32 |
+
|
| 33 |
steps:
|
| 34 |
- uses: actions/checkout@v3
|
| 35 |
with:
|
| 36 |
fetch-depth: 0
|
| 37 |
lfs: true
|
| 38 |
+
|
| 39 |
- name: Push to hub
|
| 40 |
env:
|
| 41 |
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
| 42 |
+
run: git push https://maxhuber:${{ secrets.HF_TOKEN }}@huggingface.co/spaces/maxhuber/deepsquid main
|