-
Notifications
You must be signed in to change notification settings - Fork 77
63 lines (54 loc) · 1.84 KB
/
Copy pathdocs.yml
File metadata and controls
63 lines (54 loc) · 1.84 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
name: docs
on:
push:
branches: [main]
pull_request:
# Republish without a code change, and exercise the deploy path on demand.
workflow_dispatch:
# Allow one deploy at a time; skip superseded runs rather than queueing them.
concurrency:
group: docs-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: pip
# Deliberately not `pip install .`: that runs scikit-build-core and builds
# the C++ runtime. mkdocstrings reads `python/simpler` through griffe, which
# parses statically, so the docs need neither a CANN toolkit nor the built
# nanobind extension — only the three tools below.
- name: Install docs toolchain
run: pip install -r docs/requirements.txt
- name: Build site
env:
DOCS_REF: ${{ github.event_name == 'push' && 'main' || github.sha }}
# --strict fails on a dead intra-docs link, a page missing from nav, or
# a bad anchor. No warning class is exempt.
run: mkdocs build --strict --site-dir _site
- name: Upload artifact
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
uses: actions/upload-pages-artifact@v3
with:
path: _site
deploy:
# Only main publishes; a pull request builds to prove the docs still compile.
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deploy.outputs.page_url }}
steps:
- id: deploy
uses: actions/deploy-pages@v4