-
Notifications
You must be signed in to change notification settings - Fork 14
51 lines (43 loc) · 1.5 KB
/
mkdocs_release.yml
File metadata and controls
51 lines (43 loc) · 1.5 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
name: Publish MkDocs on Release
on:
release:
types:
- published
permissions:
contents: write
pages: write
id-token: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # actions/checkout@v3
with:
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # astral-sh/setup-uv@v5
- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # actions/setup-python@v5
with:
python-version: 3.12
- name: Install docs dependencies
run: |
uv sync --group mkdocs
- name: Extract Major and Minor Version
run: |
VERSION_TAG=${{ github.event.release.tag_name }}
VERSION_TAG="${VERSION_TAG#v}" # Remove 'v' prefix if present
MAJOR="${VERSION_TAG%%.*}"
MINOR="${VERSION_TAG#*.}"
MINOR="${MINOR%%.*}"
MAJOR_MINOR_VERSION="${MAJOR}.${MINOR}"
echo "MAJOR_MINOR_VERSION=${MAJOR_MINOR_VERSION}" >> $GITHUB_ENV
- name: Deploy Updated Docs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
uv run mike deploy --push --message "Deploy docs for release ${{ github.event.release.tag_name }}" --update-alias $MAJOR_MINOR_VERSION latest
uv run mike set-default --push latest