Skip to content

Commit 749faf9

Browse files
Refine pages build workflow
Skip running the job for PRs from forked repos and consolidate CI steps: add a single Setup Python 3.13 step, install the `just` tool via `uv`, and run `just gen-doc` before the mkdocs build. Removed the explicit token input to rely on the job-level GITHUB_TOKEN permissions. These changes reduce duplication, ensure required tools are available, and avoid running deployments on forked PRs.
1 parent f996e50 commit 749faf9

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

.github/workflows/test_pages_build.yaml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ permissions: {}
1616

1717
jobs:
1818
run:
19+
# Don't run for PRs from forks
20+
if: github.event.pull_request.head.repo.full_name == github.repository
1921
# Grant GITHUB_TOKEN the permissions required to make a gh-pages deployment
2022
permissions:
2123
contents: write # to let mkdocs write the new docs
@@ -30,6 +32,12 @@ jobs:
3032
with:
3133
fetch-depth: 0
3234

35+
# https://github.com/actions/setup-python
36+
- name: Set up Python 3
37+
uses: actions/setup-python@v6.2.0
38+
with:
39+
python-version: 3.13
40+
3341
# https://github.com/astral-sh/setup-uv
3442
- name: Install uv
3543
uses: astral-sh/setup-uv@v8.1.0
@@ -38,17 +46,16 @@ jobs:
3846
enable-cache: true
3947
cache-dependency-glob: "uv.lock"
4048

41-
# https://github.com/actions/setup-python
42-
- name: Set up Python 3
43-
uses: actions/setup-python@v6.2.0
44-
with:
45-
python-version: 3.13
49+
- name: Install just
50+
run: |
51+
uv tool install rust-just
4652
4753
- name: Install dependencies
4854
run: uv sync --dev --no-progress
4955

5056
- name: Build documentation
5157
run: |
58+
just gen-doc
5259
uv run mkdocs build -d site
5360
touch site/.nojekyll
5461
@@ -58,4 +65,3 @@ jobs:
5865
with:
5966
source-dir: site/
6067
preview-branch: gh-pages
61-
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)