11name : docs
2+
23on :
3- workflow_dispatch :
4- inputs :
5- version_override :
6- description : " Manually specify the release version (e.g. 1.2.3)"
7- required : false
84 push :
95 tags :
10- - ' v*.*.*'
11- - ' v*.*.*-* ' # prereleases like beta/rc
6+ - " v*.*.*"
7+ workflow_dispatch :
128
139permissions :
1410 contents : write
@@ -18,52 +14,31 @@ jobs:
1814 runs-on : ubuntu-latest
1915 steps :
2016 - uses : actions/checkout@v4
21-
22- - name : Determine version
23- id : version
24- run : |
25- if [ -n "${{ github.event.inputs.version_override }}" ]; then
26- echo "version=${{ github.event.inputs.version_override }}" >> $GITHUB_OUTPUT
27- else
28- # tag name like "v1.2.3" or "v1.2.3-beta.1"
29- RAW_TAG="${GITHUB_REF#refs/tags/}"
30- echo "version=${RAW_TAG#v}" >> $GITHUB_OUTPUT
31- fi
32-
33- - run : git fetch origin gh-pages --depth=1
17+ with :
18+ fetch-depth : 0 # <-- required so tags + full history are present
3419
3520 - name : Configure Git Credentials
3621 run : |
3722 git config user.name github-actions[bot]
3823 git config user.email 41898282+github-actions[bot]@users.noreply.github.com
24+
3925 - uses : actions/setup-python@v5
4026 with :
4127 python-version : 3.x
28+
4229 - run : echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
4330 - uses : actions/cache@v4
4431 with :
4532 key : mkdocs-material-${{ env.cache_id }}
4633 path : ~/.cache
34+
4735 restore-keys : |
4836 mkdocs-material-
4937
50- - run : pip install uv
51-
52- - name : deploy
38+ - name : Install dependencies
5339 run : |
54- VERSION="${{ steps.version.outputs.version }}"
40+ pip install uv
5541
56- # deploy
57- uv run --group docs mike deploy --push "$VERSION"
58-
59- # stable releases only
60- if [[ "$VERSION" != *-* ]]; then
61- echo "Setting 'latest' → $VERSION"
62- uv run --group docs mike deploy --push --update-aliases "$VERSION" latest
63-
64- echo "Setting default → $VERSION"
65- uv run --group docs mike set-default "$VERSION" --push
66- else
67- uv run --group docs mike deploy --push "$VERSION"
68- echo "Prerelease: no alias, no default"
69- fi
42+ - name : Build & Deploy
43+ run : |
44+ uv run --group docs mkdocs gh-deploy --force
0 commit comments