Repository navigation
61 lines (55 loc) · 1.6 KB
/
Copy pathdocs.yml
File metadata and controls
61 lines (55 loc) · 1.6 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
name: Documentation
# Builds the MkDocs site and publishes it to GitHub Pages. Kept separate from
# ci.yml on purpose: the application checks gate whether code is correct, and
# this one gates whether the site publishes. Neither should be able to block the
# other.
#
# The repository's Pages source must be set to "GitHub Actions" in
# Settings -> Pages for the deploy step to succeed.
on:
push:
branches: [main]
paths:
- "docs/**"
- "mkdocs.yml"
- "pyproject.toml"
- ".github/workflows/docs.yml"
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
# One deployment at a time, and never cancel one in flight: a half-published site
# is worse than a slightly stale one.
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
name: Build site
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.13"
cache: pip
- run: pip install -e ".[docs]"
- name: Build with MkDocs
# Strict mode, so a broken internal link or anchor fails the build rather
# than publishing a page that cannot be navigated.
run: mkdocs build --strict
- uses: actions/configure-pages@v5
- uses: actions/upload-pages-artifact@v3
with:
path: site
deploy:
name: Deploy to GitHub Pages
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4