added HF spaces restart on release

This commit is contained in:
Gamosoft 2025-12-07 16:48:37 +01:00
parent 052e5a18e2
commit 87f5aa112d
1 changed files with 9 additions and 0 deletions

View File

@ -131,3 +131,12 @@ jobs:
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Restart Hugging Face Space
if: success()
run: |
echo "Triggering HF Space restart to pull latest image..."
curl -X POST \
"https://huggingface.co/api/spaces/${{ vars.HF_SPACE_ID }}/restart" \
-H "Authorization: Bearer ${{ secrets.HF_TOKEN }}" \
-H "Content-Type: application/json" \
--fail-with-body || echo "HF Space restart failed (Space may not exist or token invalid)"