name: Deploy to Hugging Face Spaces on: push: branches: - main workflow_dispatch: # allows manual trigger via GitHub UI jobs: deploy: runs-on: ubuntu-latest steps: - name: Checkout Repo uses: actions/checkout@v3 with: fetch-depth: 0 # This ensures the full history is retrieved - name: Set up Git run: | git config user.name "github-actions" git config user.email "actions@github.com" - name: Push to Hugging Face Spaces env: HF_TOKEN: ${{ secrets.HF_TOKEN }} run: | git push -f https://jakewatson91:$HF_TOKEN@huggingface.co/spaces/jakewatson91/sherlock HEAD:main - name: Trigger Hugging Face Rebuild run: | curl -X POST https://huggingface.co/api/spaces/jakewatson91/sherlock/restart \ -H "Authorization: Bearer ${{ secrets.HF_TOKEN }}"