Skip to content

mkdocs-gh-deploy

mkdocs-gh-deploy #3

name: mkdocs-gh-deploy
on:
push:
branches:
- main
paths:
- 'mkdocs.yml'
- 'docs/**/*.md'
- 'docs/**/*.mmd'
workflow_dispatch: # TODO: remove after testing
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Full history for git info plugin
- name: Configure Git Credentials # gh-pages branch
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- uses: actions/setup-python@v5
with:
python-version: '3.12'
# Weekly caching
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: ~/.cache
restore-keys: |
mkdocs-material-
- name: Install dependencies
run: |
pip install mkdocs-material
pip install pillow cairosvg
- name: Build documentation # Early detection of failures
run: |
mkdocs build --verbose --strict
- name: Deploy to GitHub Pages
run: |
mkdocs gh-deploy --force --verbose