Skip to content

Commit adf79fc

Browse files
Add workflow for deploying the docs
1 parent 4fe8ffb commit adf79fc

File tree

2 files changed

+65
-0
lines changed

2 files changed

+65
-0
lines changed

.github/workflows/build_docs.yaml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: build_documentation
2+
3+
# build the documentation whenever there are new commits on main
4+
on:
5+
push:
6+
branches:
7+
# - main
8+
- pdoc
9+
# TODO only build on releases once this works
10+
# Alternative: only build for tags.
11+
# tags:
12+
# - '*'
13+
14+
# security: restrict permissions for CI jobs.
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
# Build the documentation and upload the static HTML files as an artifact.
20+
build:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v2
25+
26+
- name: Setup miniconda
27+
uses: conda-incubator/setup-miniconda@v2
28+
with:
29+
activate-environment: sam
30+
mamba-version: "*"
31+
auto-update-conda: true
32+
environment-file: environment_cpu.yaml
33+
python-version: ${{ matrix.python-version }}
34+
auto-activate-base: false
35+
env:
36+
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
37+
38+
- name: Install package
39+
shell: bash -l {0}
40+
run: pip install --no-deps -e .
41+
42+
# We use a custom build script for pdoc itself, ideally you just run `pdoc -o docs/ ...` here.
43+
- name: Run pdoc
44+
shell: bash -l {0}
45+
run: pdoc --docformat google --logo "https://raw.githubusercontent.com/computational-cell-analytics/micro-sam/master/doc/images/micro-sam-logo.png" -o docs/ micro_sam
46+
47+
- uses: actions/upload-pages-artifact@v1
48+
with:
49+
path: docs/
50+
51+
# Deploy the artifact to GitHub pages.
52+
# This is a separate job so that only actions/deploy-pages has the necessary permissions.
53+
deploy:
54+
needs: build
55+
runs-on: ubuntu-latest
56+
permissions:
57+
pages: write
58+
id-token: write
59+
environment:
60+
name: github-pages
61+
url: ${{ steps.deployment.outputs.page_url }}
62+
steps:
63+
- id: deployment
64+
uses: actions/deploy-pages@v2

environment_cpu.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ name:
66
dependencies:
77
- cpuonly
88
- napari
9+
- pdoc
910
- pooch
1011
- python-elf
1112
- pytorch

0 commit comments

Comments
 (0)