Repository navigation
81 lines (68 loc) · 2.24 KB
/
Copy pathdocs.yml
File metadata and controls
81 lines (68 loc) · 2.24 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
74
75
76
77
78
79
80
81
name: Docs
# The Astro + Starlight site in docs/: hand-written pages, the executed tutorials and the API
# reference. Built on every push and pull request; deployed to GitHub Pages from devel.
on:
push:
branches: ["main", "devel"]
pull_request:
branches: ["main", "devel"]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: docs-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v6
with:
python-version: "3.12"
enable-cache: true
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: docs/package-lock.json
- name: Install the package with the docs extra
run: |
uv sync --extra docs
uv run python -m ipykernel install --user --name python3
- name: Execute and convert the tutorials
run: |
uv run python docs/tools/notebooks.py execute
uv run python docs/tools/notebooks.py convert --strict
- name: Build the site
working-directory: docs
run: |
npm ci
npm run check:mdx
DOCS_PYTHON="$(pwd)/../.venv/bin/python" npm run build
- name: Smoke test the built site
working-directory: docs
run: |
for page in /index.html /getting-started/installation/index.html /tutorials/example-tutorial/index.html /api/app/index.html /api/app/main/index.html; do
test -f "dist$page" || { echo "missing dist$page"; exit 1; }
done
grep -q 'href="/template-python/' dist/index.html || { echo "links do not use the base path"; exit 1; }
echo "all pages built with the /template-python base path"
- uses: actions/upload-pages-artifact@v3
with:
path: docs/dist
deploy:
needs: build
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/devel'
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4