Skip to content

Commit c5b7813

Browse files
committed
add build docs workflow
1 parent 9ebbfac commit c5b7813

1 file changed

Lines changed: 61 additions & 0 deletions

File tree

.github/workflows/build-docs.yaml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Build Docs
2+
on:
3+
schedule:
4+
- cron: '0 7 * * *' # UTC time
5+
workflow_dispatch:
6+
jobs:
7+
tag:
8+
name: Check if main branch is a dev version
9+
runs-on: [self-hosted, blackwell]
10+
if: github.repository == 'nunchaku-tech/nunchaku'
11+
steps:
12+
- name: Checkout main branch
13+
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
ref: main
17+
submodules: true
18+
- name: Set up Python
19+
run: |
20+
which python
21+
echo "Setting up Python with Conda"
22+
conda create -n nunchaku-docs python=3.12 -y
23+
- name: Install dependencies
24+
run: |
25+
source $(conda info --base)/etc/profile.d/conda.sh
26+
conda activate nunchaku-docs || { echo "Failed to activate conda env"; exit 1; }
27+
which python
28+
conda install -c conda-forge gxx=11 gcc=11
29+
echo "Installing dependencies"
30+
pip install torch==2.7 torchvision==0.22 torchaudio==2.7 --index-url https://download.pytorch.org/whl/cu128
31+
pip install git+https://github.com/huggingface/diffusers
32+
pip install ninja wheel transformers==4.51 accelerate==1.7 sentencepiece==0.2 protobuf==6.31 huggingface_hub==0.31
33+
pip install sphinx sphinx-tabs myst-parser sphinx-copybutton breathe sphinxcontrib-mermaid nbsphinx jupyter ipykernel graphviz sphinxext-rediraffe
34+
pip install furo sphinxawesome-theme sphinx-book-theme sphinx-rtd-theme
35+
- name: Build
36+
run: |
37+
source $(conda info --base)/etc/profile.d/conda.sh
38+
conda activate nunchaku-docs || { echo "Failed to activate conda env"; exit 1; }
39+
which python
40+
NUNCHAKU_INSTALL_MODE=ALL python setup.py develop
41+
pip install -r tests/requirements.txt
42+
- name: Build docs
43+
run: |
44+
source $(conda info --base)/etc/profile.d/conda.sh
45+
conda activate nunchaku-docs || { echo "Failed to activate conda env"; exit 1; }
46+
which python
47+
cd docs
48+
make html
49+
- name: Deploy docs
50+
run: |
51+
source $(conda info --base)/etc/profile.d/conda.sh
52+
conda activate nunchaku-docs || { echo "Failed to activate conda env"; exit 1; }
53+
which python
54+
rsync -avz --delete docs/build/html/ ${{ secrets.DO_USER }}@${{ secrets.DO_HOST }}:${{ secrets.DO_DOCS_ROOT }}/nunchaku-nightly
55+
env:
56+
RSYNC_RSH: "ssh -o StrictHostKeyChecking=no -i ${{ secrets.DO_SSH_KEY }}"
57+
- name: Clean up
58+
if: always() && github.repository == 'nunchaku-tech/nunchaku'
59+
run: |
60+
cd ..
61+
rm -r nunchaku

0 commit comments

Comments
 (0)