-
Notifications
You must be signed in to change notification settings - Fork 39
75 lines (64 loc) · 2.23 KB
/
deploy_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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Build and Deploy Docs
on:
push:
branches:
- main
tags:
- 'v*'
workflow_dispatch:
# Only allow one docs build at a time so that overlapping stale builds will get
# cancelled automatically.
concurrency:
group: deploy_docs
cancel-in-progress: true
jobs:
build-and-deploy:
name: Build & Deploy
runs-on: ubuntu-latest
steps:
- name: Clone docs repo
uses: actions/checkout@v3
with:
path: docs # place in a named directory
- name: Clone main repo
uses: actions/checkout@v3
with:
path: napari-repo # place in a named directory
ref: main
repository: napari/napari
# ensure version metadata is proper
fetch-depth: 0
- name: Copy examples to docs folder
run: |
cp -R napari-repo/examples docs
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- uses: tlambert03/setup-qt-libs@v1
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
python -m pip install "napari-repo/[all]" -c "napari-repo/resources/constraints/constraints_py3.10_docs.txt"
python -m pip install -r docs/requirements.txt -c "napari-repo/resources/constraints/constraints_py3.10_docs.txt"
- name: Testing
run: |
python -c 'import napari; print(napari.__version__)'
python -c 'import napari.layers; print(napari.layers.__doc__)'
- name: Build Docs
uses: aganders3/headless-gui@v1
env:
GOOGLE_CALENDAR_ID: ${{ secrets.GOOGLE_CALENDAR_ID }}
GOOGLE_CALENDAR_API_KEY: ${{ secrets.GOOGLE_CALENDAR_API_KEY }}
with:
# the napari-docs repo is cloned into a docs/ folder, hence the
# invocation below. Locally, you should simply run make docs
run: make -C docs docs GALLERY_PATH=../examples/
- name: Deploy Docs
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
external_repository: napari/napari.github.io
publish_dir: docs/docs/_build
publish_branch: gh-pages
destination_dir: dev
cname: napari.org