-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (88 loc) · 3.35 KB
/
Copy pathgithub-pages-mkdocs.yml
File metadata and controls
96 lines (88 loc) · 3.35 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Deploy MkDocs
permissions:
contents: write
pages: write
on:
push:
branches:
- main
pull_request:
branches:
- '**' # Match all branches for pull requests
release:
types:
- published
workflow_run:
workflows: ['github-release']
types: [completed]
jobs:
deploy-pr:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
# Serialize with deploy-main: both push to the shared gh-pages branch,
# and running them concurrently races the git push (non-fast-forward
# rejection). deploy-release is deliberately excluded from this group —
# a release deploy must run to completion regardless of any PR or other
# release build in flight.
concurrency:
group: mkdocs-deploy-pr-main
cancel-in-progress: false
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- uses: serapeum-org/github-actions/actions/mkdocs-deploy@38c111084f99d5ff5f4a1e63bedce48fe33a10c0 # mkdocs/v1.3.1
with:
trigger: 'pull_request'
package-manager: 'uv'
python-version: '3.12'
install-groups: 'groups: docs, extras: tiles science-colors'
notebooks-path: 'docs/notebooks'
notebooks-exclude: '**/.ipynb_checkpoints/**'
deploy-token: ${{ secrets.ACTIONS_DEPLOY_TOKEN }}
deploy-main:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
concurrency:
group: mkdocs-deploy-pr-main
cancel-in-progress: false
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- uses: serapeum-org/github-actions/actions/mkdocs-deploy@38c111084f99d5ff5f4a1e63bedce48fe33a10c0 # mkdocs/v1.3.1
with:
trigger: 'main'
package-manager: 'uv'
python-version: '3.12'
install-groups: 'groups: docs, extras: tiles science-colors'
notebooks-path: 'docs/notebooks'
notebooks-exclude: '**/.ipynb_checkpoints/**'
deploy-token: ${{ secrets.ACTIONS_DEPLOY_TOKEN }}
deploy-release:
if: >-
github.event_name == 'release' ||
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.head_repository.full_name == github.repository)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
ref: ${{ github.event.workflow_run.head_branch || github.ref }}
- name: Extract version from pyproject.toml
id: version
run: |
VERSION=$(grep -m1 '^version' pyproject.toml | sed 's/.*"\(.*\)"/\1/')
echo "tag=$VERSION" >> $GITHUB_OUTPUT
- uses: serapeum-org/github-actions/actions/mkdocs-deploy@38c111084f99d5ff5f4a1e63bedce48fe33a10c0 # mkdocs/v1.3.1
with:
trigger: 'release'
package-manager: 'uv'
python-version: '3.12'
install-groups: 'groups: docs, extras: tiles science-colors'
notebooks-path: 'docs/notebooks'
notebooks-exclude: '**/.ipynb_checkpoints/**'
deploy-token: ${{ secrets.ACTIONS_DEPLOY_TOKEN }}
release-tag: ${{ github.event.release.tag_name || steps.version.outputs.tag }}
mike-alias: 'latest'