Repository navigation
60 lines (51 loc) · 1.54 KB
/
Copy pathdocs.yml
File metadata and controls
60 lines (51 loc) · 1.54 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
name: Docs
on:
push:
branches: [master]
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: pages-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
python-version: "3.12"
# Same shape as ci.yml: `--system` fails on the runner's
# externally-managed interpreter, so build a venv and put it on PATH.
- name: Install docs dependencies
run: |
uv venv
uv pip install -e ".[docs]"
echo "$GITHUB_WORKSPACE/.venv/bin" >> $GITHUB_PATH
# --strict turns a dead internal link or a page missing from nav into a
# build failure, so a PR that breaks navigation cannot reach master.
- name: Build site
run: mkdocs build --strict
- name: Upload Pages artifact
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
uses: actions/upload-pages-artifact@v3
with:
path: site
# Deploy only from master. Pull requests run the build above and stop there,
# so a fork PR can never publish.
deploy:
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4