| name: Deploy to Hugging Face Space | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - name: Configure Git | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Add Hugging Face remote | |
| run: | | |
| git remote add space https://jdsb06:${{ secrets.HF_TOKEN }}@huggingface.co/spaces/jdsb06/meta-r2 || git remote set-url space https://jdsb06:${{ secrets.HF_TOKEN }}@huggingface.co/spaces/jdsb06/meta-r2 | |
| - name: Push to Hugging Face Space | |
| run: | | |
| git checkout --orphan hf-space-deploy | |
| git add -A | |
| # Strip oversized and binary artifacts from the deploy snapshot. | |
| git rm --cached --ignore-unmatch data/preseeded_memory.json docs/training_curves.png docs/reward_curve.png data/*.png data/*.bin data/*.whl plots/*.png train_run_v1.log || true | |
| git commit -m "Deploy Space snapshot" | |
| git push --force space hf-space-deploy:main | |