| name: Sync to Hugging Face hub | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| sync-to-hub: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 # Ensures full history is fetched | |
| lfs: true | |
| - name: Pull latest changes | |
| run: git pull origin main # Pull latest changes from remote before pushing | |
| - name: Force push to hub | |
| env: | |
| HF_TOKEN: ${{ secrets.token }} | |
| run: git push --force https://j565xu:$HF_TOKEN@huggingface.co/spaces/j565xu/test main | |
| - name: Check status after pull | |
| run: git status | |