Skip to content

Commit 189f4a3

Browse files
authored
Add build_docs action to PRs (#6)
1 parent 42313f6 commit 189f4a3

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+
with:
17+
path: docs
18+
19+
- name: Clone main repo
20+
uses: actions/checkout@v3
21+
with:
22+
path: napari
23+
repository: napari/napari
24+
25+
- uses: actions/setup-python@v2
26+
with:
27+
python-version: 3.9
28+
29+
- uses: tlambert03/setup-qt-libs@v1
30+
31+
- name: Install Dependencies
32+
run: |
33+
python -m pip install --upgrade pip
34+
python -m pip install "napari/[all]"
35+
36+
- name: Testing
37+
run: |
38+
python -c 'import napari; print(napari.__version__)'
39+
python -c 'import napari.layers; print(napari.layers.__doc__)'
40+
41+
- name: Build Docs
42+
uses: GabrielBB/xvfb-action@v1
43+
env:
44+
GOOGLE_CALENDAR_ID: ${{ secrets.GOOGLE_CALENDAR_ID }}
45+
GOOGLE_CALENDAR_API_KEY: ${{ secrets.GOOGLE_CALENDAR_API_KEY }}
46+
with:
47+
run: make -C docs/ docs
48+
49+
- name: Upload artifact
50+
uses: actions/upload-artifact@v2
51+
with:
52+
name: docs
53+
path: docs/docs/_build

docs/conf.py

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

192192

193193
sphinx_gallery_conf = {
194-
'examples_dirs': '../examples', # path to your example scripts
194+
'examples_dirs': '../../napari/examples', # path to your example scripts
195195
'gallery_dirs': 'gallery', # path to where to save gallery generated output
196196
'filename_pattern': '/*.py',
197197
'ignore_pattern': 'README.rst|/*_.py',

0 commit comments

Comments
 (0)