Repository navigation
70 lines (65 loc) · 2.09 KB
/
Copy pathdocs.yml
File metadata and controls
70 lines (65 loc) · 2.09 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
# Builds the MkDocs documentation site and deploys it to GitHub Pages.
#
# Setup (one time, in the repository settings):
# Settings > Pages > Build and deployment > Source: "GitHub Actions"
#
# After that, every push to `master` that touches the docs, the source, or this
# workflow rebuilds and publishes https://<owner>.github.io/radCAD/.
name: Documentation
on:
push:
branches: [ master ]
paths:
- 'docs/**'
- 'mkdocs.yml'
- 'radcad/**'
- '.github/workflows/docs.yml'
pull_request:
branches: [ master ]
paths:
- 'docs/**'
- 'mkdocs.yml'
- 'radcad/**'
- '.github/workflows/docs.yml'
workflow_dispatch:
# Allow only one concurrent deployment, skipping runs queued between the run
# in-progress and latest queued. Do not cancel in-progress runs.
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install uv
run: python -m pip install --upgrade pip uv
- name: Build site (strict)
# `uv run` syncs radCAD plus the docs extras (no dev group) from the
# lockfile, then runs mkdocs in that environment.
run: uv run --frozen --extra docs --no-dev mkdocs build --strict
- name: Upload Pages artifact
# Only publish from master; PRs build for validation only.
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
uses: actions/upload-pages-artifact@v3
with:
path: site
deploy:
# Only deploy on push to master / manual dispatch, not on pull requests.
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
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@v4