Skip to content

Commit 652b7d1

Browse files
committed
Publish mkdocs Workflow Action
1 parent 36ff34f commit 652b7d1

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

Diff for: .github/workflows/mkdocs-publish.yml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Publish MkDocs Documentation
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Version to deploy (e.g. 20.0)'
8+
required: true
9+
default: '20.0'
10+
type: string
11+
update_latest:
12+
description: 'Update this as latest version?'
13+
required: true
14+
default: true
15+
type: boolean
16+
17+
permissions:
18+
contents: write
19+
pages: write
20+
21+
jobs:
22+
deploy:
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- uses: actions/checkout@v4
27+
with:
28+
fetch-depth: 0 # Required for mike to work properly
29+
30+
- name: Set up Python
31+
uses: actions/setup-python@v5
32+
with:
33+
python-version: '3.11'
34+
35+
- name: Set up Git
36+
run: |
37+
git config --global user.name "github-actions[bot]"
38+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
39+
40+
- name: Install dependencies
41+
run: |
42+
python -m pip install --upgrade pip
43+
pip install \
44+
mike \
45+
mkdocs-material \
46+
mkdocs-macros-plugin \
47+
mkdocs-monorepo-plugin \
48+
mkdocs-site-urls \
49+
mkdocs-caption \
50+
markdown-tables-extended
51+
52+
- name: Deploy documentation
53+
run: |
54+
if [ "${{ inputs.update_latest }}" = "true" ]; then
55+
mike deploy --push ${{ inputs.version }} latest
56+
else
57+
mike deploy --push ${{ inputs.version }}
58+
fi

0 commit comments

Comments
 (0)