Repository navigation
73 lines (63 loc) · 2.11 KB
/
Copy pathdocs.yml
File metadata and controls
73 lines (63 loc) · 2.11 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
name: Docs
# Build the MkDocs site on every docs PR (--strict, so broken links/config
# fail the check) and deploy it to GitHub Pages on push to main. Pages is
# configured with Source: "GitHub Actions", so deployment goes through the
# official pages artifact flow — no gh-pages branch.
on:
push:
branches: [main]
paths:
- "docs/**"
- "mkdocs.yml"
- ".github/workflows/docs.yml"
pull_request:
paths:
- "docs/**"
- "mkdocs.yml"
- ".github/workflows/docs.yml"
permissions:
contents: read
concurrency:
# Deployments serialize on the single "pages" group (GitHub permits one
# in-flight Pages deployment). PR validation gets a per-ref group so a
# queued deploy is never evicted by a later PR event (#397): GitHub keeps
# only one PENDING run per group, and cancel-in-progress:false only
# protects the in-progress run, not the queue.
group: ${{ github.event_name == 'push' && 'pages' || format('pages-pr-{0}', github.ref) }}
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: "3.12"
cache: "pip"
- name: Install MkDocs
# Material pins a compatible MkDocs; the upper bounds keep CI off
# future majors (MkDocs 2.0 is currently unlicensed — see the
# mkdocs-material 2026-02-18 advisory) until deliberately bumped.
run: pip install "mkdocs-material>=9.7,<10" "mkdocs-static-i18n>=1.3,<2"
- name: Build site (strict)
run: mkdocs build --strict
- name: Upload Pages artifact
if: github.event_name == 'push'
uses: actions/upload-pages-artifact@v5
with:
path: site
deploy:
if: 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:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5