Repository navigation
69 lines (67 loc) · 2.03 KB
/
Copy pathdocs.yml
File metadata and controls
69 lines (67 loc) · 2.03 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
64
65
66
67
68
69
name: Build Sphinx docs
on:
workflow_dispatch:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+*"
branches:
- main
- 'stable/**'
pull_request:
branches:
- main
- 'stable/**'
jobs:
build:
name: Build docs
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v7
with:
# reno reads the tags and their history to assemble the release notes, and
# setup.py needs the vendored upstream headers to compile the extension.
fetch-depth: 0
submodules: recursive
- uses: actions/setup-python@v7
with:
python-version: '3.10'
- name: Install dependencies
# autodoc imports the package, so the extension has to compile here -- hence the
# same MPI and BLAS packages the test workflow installs, rather than the lighter
# set a pure-Python docs build would need.
run: |
python -m pip install --upgrade pip
pip install tox
sudo apt-get update
sudo apt-get install -y libopenmpi-dev openmpi-bin libopenblas-dev
- name: Build docs
shell: bash
# CPU only: the runner has no GPU toolchain, and the API reference does not
# depend on which backends were compiled.
env:
SBD_BUILD_BACKEND: cpu
run: |
tox -edocs
- name: Upload docs artifact
# Uploaded even on failure, which pairs with sphinx-build's --keep-going: the
# partial HTML is usually the fastest way to see what went wrong.
if: always()
uses: actions/upload-pages-artifact@v5
with:
path: docs/_build/html
deploy:
name: Deploy docs
if: ${{ github.ref == 'refs/heads/main' }}
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5