name: Sync to Hugging Face Space on: push: branches: [main] jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: fetch-depth: 0 lfs: true - name: Set up Python uses: actions/setup-python@v5 with: python-version: "3.11" - name: Sanity-check app.py compiles run: python -m py_compile app.py - name: Inject HF Space front matter into README run: | { cat .hf/README.header.md; echo; cat README.md; } > README.hf.md mv README.hf.md README.md git config user.email "actions@github.com" git config user.name "github-actions" git add README.md git commit -m "chore(hf): inject Space front matter" - name: Push to Hugging Face Space env: HF_TOKEN: ${{ secrets.HF_TOKEN }} run: | git remote add space https://oauth2:${HF_TOKEN}@huggingface.co/spaces/jbenbudd/ptm-llama git push --force space main