fix(ci): switch HF deploy to huggingface-cli upload #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy to Hugging Face Spaces | |
| on: | |
| push: | |
| branches: [main] | |
| paths-ignore: | |
| - 'quarto/**' | |
| - 'docs/**' | |
| - 'tests/**' | |
| - '*.md' | |
| - '!hf-spaces/README.md' | |
| workflow_dispatch: | |
| concurrency: | |
| group: hf-spaces-deploy | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| deploy-hf: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| lfs: true | |
| - name: Prepare HF Spaces deployment | |
| run: | | |
| # Replace README with HF Spaces version (YAML frontmatter for Docker SDK) | |
| cp hf-spaces/README.md README.md | |
| # Remove files not needed in HF Space | |
| rm -rf hf-spaces/ | |
| - name: Install huggingface-cli | |
| run: pip install huggingface_hub | |
| - name: Upload to Hugging Face Spaces | |
| env: | |
| HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
| run: | | |
| huggingface-cli upload pjt222/jigsawR . . --repo-type space --token $HF_TOKEN |