1- # SPDX-FileCopyrightText: 2025 Toon Verstraelen <Toon.Verstraelen@UGent.be>
1+ # SPDX-FileCopyrightText: 2024 Toon Verstraelen <Toon.Verstraelen@UGent.be>
22# SPDX-License-Identifier: LGPL-3.0-or-later
33
44# This workflow assumes that you deploy the documentation from the gh-pages branch.
3131 - pyproject.toml
3232 - .github/workflows/mkdocs.yaml
3333
34- permissions :
35- contents : write
36-
3734# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
3835# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
3936concurrency :
4037 group : pages
4138 cancel-in-progress : false
4239
4340jobs :
44- build :
41+ check :
42+ permissions :
43+ contents : read
4544 runs-on : ubuntu-latest
4645 steps :
4746 # Get the source
4847 - uses : actions/checkout@v6
48+ with :
49+ persist-credentials : false
4950 - uses : actions/setup-python@v6
5051 with :
5152 python-version : 3.x
@@ -54,22 +55,39 @@ jobs:
5455 with :
5556 enable-cache : true
5657 cache-dependency-glob : pyproject.toml
58+ - name : Install development version
59+ run : uv pip install --system -e .[dev]
60+ - name : Build mkdocs site
61+ run : mkdocs build --strict
5762
58- # Prepare the environment for building docs.
59- - name : Setup Pages
60- id : pages
61- uses : actions/configure-pages@v6
63+ deploy :
64+ needs : check
65+ if : github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
66+ permissions :
67+ contents : write
68+ runs-on : ubuntu-latest
69+ steps :
70+ # Get the source
71+ - uses : actions/checkout@v6
72+ - uses : actions/setup-python@v6
73+ with :
74+ python-version : 3.x
75+ - name : Set up uv
76+ uses : astral-sh/setup-uv@v8.2.0
77+ with :
78+ enable-cache : true
79+ cache-dependency-glob : pyproject.toml
6280 - name : Install development version
6381 run : uv pip install --system -e .[dev]
6482
65- # Update the site using to the gh-pages branch with mike.
83+ # Update the site using the gh-pages branch with mike.
6684 - name : Get the docs branch
6785 run : git fetch --depth=1 origin gh-pages
6886 - name : Configure Git user for documentation commit
6987 run : |
7088 git config --global user.name 'github-actions[bot]'
7189 git config --global user.email 'github-actions[bot]@users.noreply.github.com'
72- - name : Build mkdocs
90+ - name : Build docs snapshot
7391 run : mike deploy dev
7492 - name : Push gh-pages branch with development version of docs
7593 if : github.ref == 'refs/heads/main'
0 commit comments