Skip to content

fix: update for ci build #20

fix: update for ci build

fix: update for ci build #20

name: Deploy to Hugging Face Spaces
on:
push:
branches: [ main ]
workflow_dispatch:
env:
OMP_NUM_THREADS: 8
MKL_NUM_THREADS: 8
jobs:
build-and-deploy-gpu:
name: Build & Deploy (GPU)
runs-on:
group: aws-g6e-4xlarge
container:
image: pytorch/pytorch:2.3.1-cuda12.1-cudnn8-runtime
options: --gpus all --ipc host --shm-size "16gb"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Show NVIDIA GPUs
run: |
nvidia-smi || true
- name: System deps (git, curl, etc.)
run: |
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
git curl ca-certificates build-essential
rm -rf /var/lib/apt/lists/*
- name: Install Node.js (for act)
if: ${{ env.ACT }}
run: |
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
apt-get install -y nodejs
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: latest
- name: Prepare Python 3.11
run: |
echo "Installing Python 3.11"
uv python install 3.11
echo "UV_PYTHON=3.11" >> "$GITHUB_ENV"
- name: Build site with uvnote (GPU available)
run: |
# If your build uses CUDA, it will see the GPUs here.
# --strict will fail if any cells do not succeed.
uvx https://github.com/drbh/uvnote.git build benches --strict
- name: Deploy to Hugging Face Space
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
# Upload the built site/ directory to the Space, cleaning removed files
echo "Deploying to Hugging Face Space drbh/uvnote-book-explore"
# uvx --from huggingface-hub hf upload \
# --token "$HF_TOKEN" \
# --delete \
# --exclude "*.json" \
# --exclude "*.pt" \
# --repo-type space \
# drbh/uvnote-book-explore \
# site/ /