IIIF-Studio / .github /workflows /deploy-hf.yml
Claude
fix: comprehensive repo audit — 15 issues fixed
9097545 unverified
# Déploiement automatique sur HuggingFace Spaces à chaque push sur main.
# Bloqué si le job tests échoue (needs: tests).
#
# Prérequis GitHub :
# Settings → Secrets and variables → Actions → New repository secret
# Nom : HF_TOKEN
# Valeur : token HuggingFace avec permission "write" sur le Space
name: Deploy to HuggingFace Spaces
on:
push:
branches:
- main
jobs:
tests:
uses: ./.github/workflows/tests.yml
deploy:
runs-on: ubuntu-latest
needs: tests
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true # opt-in Node.js 24 (requis dès juin 2026)
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # historique complet pour le push HF
- name: Push to HuggingFace Space
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
HF_USERNAME: ${{ vars.HF_USERNAME || 'Ma-Ri-Ba-Ku' }}
HF_SPACE: ${{ vars.HF_SPACE || 'IIIF-Studio' }}
run: |
git config user.email "github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
git remote add hf "https://${HF_USERNAME}:${HF_TOKEN}@huggingface.co/spaces/${HF_USERNAME}/${HF_SPACE}"
git push hf main --force