name: Sync to Hugging Face Space on: push: branches: [main] workflow_dispatch: jobs: deploy-to-space: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 with: fetch-depth: 0 lfs: true - name: Configure git identity run: | git config user.email "github-actions[bot]@users.noreply.github.com" git config user.name "github-actions[bot]" - name: Push to Hugging Face Space env: HF_TOKEN: ${{ secrets.HF_TOKEN }} run: | # Retry up to 3 times with 30s delay to handle HF rate limits (429) for attempt in 1 2 3; do echo "Push attempt $attempt..." git push --force https://ajmel:$HF_TOKEN@huggingface.co/spaces/ajmel/multi-content-engine main && break echo "Attempt $attempt failed. Waiting 30s before retry..." sleep 30 done