Skip to content

feat: use artifacts to style results page #16

feat: use artifacts to style results page

feat: use artifacts to style results page #16

name: Deploy to Hugging Face Spaces
on:
push:
branches: [ main ]
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"
- name: Deploy via HF Job
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
# Create secrets file for HF job
echo "HF_TOKEN=$HF_TOKEN" > .sec
# Run uvnote build on GPU-enabled HF job and deploy
uvx --from huggingface-hub \
hf jobs run \
--secrets-file .sec \
--flavor a10g-largex4 \
ghcr.io/astral-sh/uv:debian \
/bin/bash -c \
"
# Install Python 3.11 and set as default
uv python install 3.11 && \
export UV_PYTHON=3.11 && \
# Clone the repository
git clone https://github.com/${{ github.repository }}.git repo && \
cd repo && \
# Build the uvnote site
uvx https://github.com/drbh/uvnote.git build . && \
# Deploy to Hugging Face Space
uvx --from huggingface-hub \
hf upload \
--token \$HF_TOKEN \
--delete \
--exclude \"*.json\" \
--exclude \"*.pt\" \
--repo-type space \
drbh/uvnote-book-explore \
site/ /
"