name: Deploy to Hugging Face Space on: push: branches: - main jobs: deploy: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 - name: Setup Git run: | git config --global user.email "github-actions@users.noreply.github.com" git config --global user.name "github-actions" - name: Push to Hugging Face Space env: HF_TOKEN: ${{ secrets.HF_TOKEN }} run: | git clone https://$HF_USERNAME:$HF_TOKEN@huggingface.co/$HF_REPO hf-space cp -r ./* hf-space/ || true cd hf-space git add . git commit -m "CI/CD deploy from GitHub" || echo "No changes" git push