forked from deepinv/deepinv
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (58 loc) · 1.86 KB
/
Copy pathdocumentation.yml
File metadata and controls
63 lines (58 loc) · 1.86 KB
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
name: Build docs
# Runs on pushes targeting the default branch
on:
push:
branches:
- main
pull_request:
branches:
- main
# Cancel in-progress runs when pushing a new commit on the PR
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: write
pull-requests: write
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v5
with:
python-version: 3.12
cache: 'pip' # caching pip dependencies
- name: Install deepinv and its dependencies
run: |
pip install -e .[dataset,denoisers,doc,training]
- name: Sphinx build
run: |
sphinx-build -W docs/source _build
- name: Run doctests
env:
SPHINX_DOCTEST: "1"
run: |
# Run doctest with sphinx, to get the extra IGNORE_OUTPUT primitive
# using plot_gallery=0 to avoid building examples
sphinx-build -M doctest docs/source docs/build -D plot_gallery=0 -v
- name: Upload Documentation Artifact
id: upload-artifact
uses: actions/upload-artifact@v4
with:
name: documentation
path: _build/
# Log artifact URL
- name: Link to generated docs here
if: ${{ github.event_name == 'pull_request' && github.event.action != 'closed' }}
run: |
echo "Documentation artifact URL: ${{ steps.upload-artifact.outputs.artifact-url }}"
- name: Deploy to ghpages
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: _build/
force_orphan: true
enable_jekyll: false