-
Notifications
You must be signed in to change notification settings - Fork 11
58 lines (51 loc) · 1.73 KB
/
docs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Documentation
on:
push:
branches:
- main
paths:
- 'docs/**'
- 'examples/**'
- 'scripts/**'
- 'mkdocs.yml'
- '.github/workflows/docs.yml'
permissions:
contents: write
jobs:
docs:
# Only run if commit message contains [build-docs]
if: "contains(github.event.head_commit.message, '[build-docs]')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # fetch all history for proper versioning
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[docs]
# TODO: Enable this section when GPU runner is available
# - name: Convert notebooks to markdown
# env:
# TESTING: "true"
# JUPYTER_CONFIG_DIR: "/tmp/jupyter-config"
# run: |
# # Convert notebooks to markdown
# jupyter nbconvert --to markdown examples/*.ipynb --output-dir docs/examples/ --TagRemovePreprocessor.remove_cell_tags hide
# # Note: This step requires GPU access. Currently notebooks should be converted locally
# # and committed to the repository. When setting up GPU runner:
# # 1. Use a runner with GPU support
# # 2. Add necessary CUDA dependencies
# # 3. Uncomment this section
- name: Build script documentation
run: |
python docs/script_to_md.py
- name: Deploy documentation
run: |
git config --global user.name "github-actions"
git config --global user.email "[email protected]"
mkdocs gh-deploy --force