Skip to content

fix(ci): add local bin to PATH for huggingface-cli #6

fix(ci): add local bin to PATH for huggingface-cli

fix(ci): add local bin to PATH for huggingface-cli #6

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