Skip to content

Publish MkDocs Documentation #1

Publish MkDocs Documentation

Publish MkDocs Documentation #1

name: Publish MkDocs Documentation
on:
workflow_dispatch:
inputs:
version:
description: 'Version to deploy (e.g. 20.0)'
required: true
default: '20.0'
type: string
update_latest:
description: 'Update this as latest version?'
required: true
default: true
type: boolean
permissions:
contents: write
pages: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Required for mike to work properly
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Set up Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install \
mike \
mkdocs-material \
mkdocs-macros-plugin \
mkdocs-monorepo-plugin \
mkdocs-site-urls \
mkdocs-caption \
markdown-tables-extended
- name: Deploy documentation
run: |
if [ "${{ inputs.update_latest }}" = "true" ]; then
mike deploy --push ${{ inputs.version }} latest
else
mike deploy --push ${{ inputs.version }}
fi