Skip to content

Commit c422be6

Browse files
committed
Add build_docs action to PRs
1 parent 89cd074 commit c422be6

File tree

2 files changed

+54
-1
lines changed

2 files changed

+54
-1
lines changed

.github/workflows/build_docs.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Build PR Docs
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
build-and-upload:
11+
name: Build & Upload Artifact
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Clone docs repo
15+
uses: actions/checkout@v3
16+
17+
- name: Clone main repo
18+
uses: actions/checkout@v3
19+
with:
20+
path: napari
21+
repository: napari/napari
22+
23+
- uses: actions/setup-python@v2
24+
with:
25+
python-version: 3.9
26+
27+
- uses: tlambert03/setup-qt-libs@v1
28+
29+
- name: Install Dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
python -m pip install "napari/[all]"
33+
34+
- name: Testing
35+
run: |
36+
python -c 'import napari; print(napari.__version__)'
37+
python -c 'import napari.layers; print(napari.layers.__doc__)'
38+
39+
- name: Build Docs
40+
uses: GabrielBB/xvfb-action@v1
41+
env:
42+
GOOGLE_CALENDAR_ID: ${{ secrets.GOOGLE_CALENDAR_ID }}
43+
GOOGLE_CALENDAR_API_KEY: ${{ secrets.GOOGLE_CALENDAR_API_KEY }}
44+
with:
45+
# the napari-docs repo is cloned into a docs/ folder, hence the
46+
# invocation below. Locally, you should simply run make docs
47+
run: make docs
48+
49+
- name: Upload artifact
50+
uses: actions/upload-artifact@v2
51+
with:
52+
name: docs
53+
path: docs/_build

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def reset_napari_theme(gallery_conf, fname):
168168

169169

170170
sphinx_gallery_conf = {
171-
'examples_dirs': '../examples', # path to your example scripts
171+
'examples_dirs': '../../napari/examples', # path to your example scripts
172172
'gallery_dirs': 'gallery', # path to where to save gallery generated output
173173
'filename_pattern': '/*.py',
174174
'ignore_pattern': 'README.rst|/*_.py',

0 commit comments

Comments
 (0)