-
Notifications
You must be signed in to change notification settings - Fork 3
83 lines (71 loc) · 2.35 KB
/
Copy pathdeploy-docs.yml
File metadata and controls
83 lines (71 loc) · 2.35 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Deploy Documentation
# Builds the MkDocs Material site (source: `site_docs/`) with
# `make docs-build` (which runs `mkdocs build --strict`) and
# publishes the generated `site/` to GitHub Pages.
#
# The previous hand-rolled HTML site at `website/` is preserved
# in the repo as the rollback source and historical reference,
# but is no longer deployed. Live URLs from the old site are
# preserved by the `mkdocs-redirects` plugin (see mkdocs.yml).
on:
push:
branches:
- master
paths:
- 'site_docs/**'
- 'mkdocs.yml'
- 'requirements-docs.txt'
- 'Makefile'
- '.github/workflows/deploy-docs.yml'
workflow_dispatch:
permissions:
contents: read
jobs:
build:
name: Build MkDocs site
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: pip
cache-dependency-path: requirements-docs.txt
- name: Install docs dependencies
run: pip install -r requirements-docs.txt
- name: Install GenAIRR from PyPI (mkdocstrings needs to import it)
# The reference pages use `:::` mkdocstrings directives to render
# signatures + docstrings from real classes (Experiment,
# SimulationResult, ReferenceCartridgeBuilder, etc.). For those
# to resolve, GenAIRR must be importable in the build environment.
# Installing from PyPI is fast (precompiled wheels) and means the
# rendered API reference matches the latest released version,
# which is what published docs should reflect.
run: pip install GenAIRR
- name: Build site with mkdocs build --strict
run: make docs-build
env:
DISABLE_MKDOCS_2_WARNING: 'true'
- name: Configure Pages
uses: actions/configure-pages@v5
- name: Upload Build Artifact
uses: actions/upload-pages-artifact@v3
with:
path: site
deploy:
name: Deploy to GitHub Pages
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@v4