fix(ci): add local bin to PATH for huggingface-cli #6
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: Upload to Hugging Face Spaces | |
| env: | |
| HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
| run: | | |
| pip install -q huggingface_hub[cli] | |
| export PATH="$HOME/.local/bin:$PATH" | |
| huggingface-cli upload pjt222/jigsawR . . --repo-type space --token $HF_TOKEN |