| name: Check file size and Sync to Hugging Face hub |
| on: |
| push: |
| branches: [main] |
| pull_request: |
| branches: [main] |
| workflow_dispatch: |
|
|
| jobs: |
| check-file-size: |
| runs-on: ubuntu-latest |
| steps: |
| - uses: actions/checkout@v3 |
| - name: Check large files |
| run: | |
| #!/bin/bash |
| max_size=10485760 # 10MB in bytes |
| large_files=$(find . -type f -size +${max_size}c) |
| if [ -n "$large_files" ]; then |
| echo "Warning: The following files are larger than 10MB:" |
| echo "$large_files" |
| exit 1 |
| else |
| echo "No files larger than 10MB found." |
| fi |
| |
| sync-to-hub: |
| needs: check-file-size |
| runs-on: ubuntu-latest |
| steps: |
| - uses: actions/checkout@v3 |
| with: |
| fetch-depth: 0 |
| lfs: true |
| - name: Push to hub |
| env: |
| HF_TOKEN: ${{ secrets.HF_TOKEN }} |
| run: git push https://maxhuber:${{ secrets.HF_TOKEN }}@huggingface.co/spaces/maxhuber/deepsquid main -f |
|
|