-
Notifications
You must be signed in to change notification settings - Fork 5
67 lines (56 loc) · 1.74 KB
/
Copy pathtest_pages_build.yaml
File metadata and controls
67 lines (56 loc) · 1.74 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
name: Preview documentation build
on: # yamllint disable-line rule:truthy
pull_request:
types:
- opened
- reopened
- synchronize
env:
CLICOLOR: 1
concurrency: preview-${{ github.ref }}
permissions: {}
jobs:
run:
# Don't run for PRs from forks
if: github.event.pull_request.head.repo.full_name == github.repository
# Grant GITHUB_TOKEN the permissions required to make a gh-pages deployment
permissions:
contents: write # to let mkdocs write the new docs
pages: write # to deploy to Pages
id-token: write # allow to generate an OpenID Connect (OIDC) token
pull-requests: write # add comment on the PR with the preview URL
runs-on: ubuntu-latest
steps:
# https://github.com/actions/checkout
- name: Checkout
uses: actions/checkout@v6.0.2
with:
fetch-depth: 0
# https://github.com/actions/setup-python
- name: Set up Python 3
uses: actions/setup-python@v6.2.0
with:
python-version: 3.13
# https://github.com/astral-sh/setup-uv
- name: Install uv
uses: astral-sh/setup-uv@v8.0.0
with:
python-version: 3.13
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install just
run: |
uv tool install rust-just
- name: Install dependencies
run: uv sync --dev --no-progress
- name: Build documentation
run: |
just gen-doc
uv run mkdocs build -d site
touch site/.nojekyll
# https://github.com/rossjrw/pr-preview-action
- name: Deploy preview
uses: rossjrw/pr-preview-action@v1.8.1
with:
source-dir: site/
preview-branch: gh-pages