Repository navigation
65 lines (57 loc) · 1.93 KB
/
Copy pathdocs.yml
File metadata and controls
65 lines (57 loc) · 1.93 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
name: Documentation
on:
push:
branches: [main]
tags: ['v*']
pull_request:
branches: [main]
permissions:
contents: read
jobs:
# Built on every pull request as well, so that a broken link or a page left
# out of the toctree fails there rather than on the way to the site.
build:
runs-on: ubuntu-latest
steps:
# The site carries one rendering per release, read out of the tags, so
# the checkout needs the whole history rather than the one commit.
- uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: ./.github/actions/dependencies
# Separate from the dev group the shared action installs: sphinx and the
# theme are of no use to the tests.
- name: Install the documentation dependencies
run: uv pip install --python .venv/bin/python --group docs
# The generated pages are read out of the binaries, so this builds the
# programs before it renders anything.
- run: make site
# The step above rewrites the generated blocks in place, so a page committed
# without being rebuilt differs here from what the binaries describe.
- name: Check the generated pages are current
run: |
git diff --exit-code docs/ || {
echo "::error::a page is out of date with the program it describes; run make docs"
exit 1
}
- uses: actions/upload-pages-artifact@v3
with:
path: site
deploy:
needs: build
if: github.event_name == 'push'
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
# One deployment at a time, with a later push waiting rather than replacing
# the run already under way.
concurrency:
group: pages
cancel-in-progress: false
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4