Skip to content

Commit 088e734

Browse files
Merge pull request #88 from computational-cell-analytics/pdoc
Add workflow for deploying the docs
2 parents 4fe8ffb + 8a95e6f commit 088e734

File tree

3 files changed

+88
-0
lines changed

3 files changed

+88
-0
lines changed

.github/workflows/build_docs.yaml

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

.github/workflows/doc_env.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
channels:
2+
- pytorch
3+
- conda-forge
4+
name:
5+
sam
6+
dependencies:
7+
- cpuonly
8+
- pdoc
9+
- pooch
10+
- python-elf
11+
- pytorch
12+
- torchvision
13+
- tqdm
14+
- zarr
15+
- pip:
16+
- git+https://github.com/facebookresearch/segment-anything.git

micro_sam/__init__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,12 @@
33
.. include:: ../doc/annotation_tools.md
44
.. include:: ../doc/installaiton.md
55
"""
6+
7+
__all__ = [
8+
"instance_segmentation",
9+
"prompt_based_segmentation",
10+
"prompt_generators",
11+
"sample_data",
12+
"util",
13+
"visualization",
14+
]

0 commit comments

Comments
 (0)