Publish MkDocs (mike) #85
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Publish MkDocs documentation using mike for versioning | |
| # | |
| # Triggers: | |
| # - Push to main branch (paths: mkdocs.yml, mkdocs/**) | |
| # - Manual workflow dispatch | |
| # | |
| # Deploys to gh-pages branch using mike for version management | |
| name: Publish MkDocs (mike) | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'mkdocs.yml' | |
| - 'mkdocs/**' | |
| workflow_dispatch: | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Full history for mike versioning | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install mkdocs==1.6.1 mkdocs-material==9.7.1 pymdown-extensions==10.7.1 | |
| pip install mike==2.1.0 mkdocs-git-revision-date-localized-plugin==1.2.6 mkdocs-minify-plugin==0.8.0 | |
| pip install mkdocs-glightbox | |
| - name: Build documentation (sanity check) | |
| run: mkdocs build --strict | |
| - name: Configure git author | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Deploy latest to gh-pages | |
| run: | | |
| mike deploy --push --remote origin --branch gh-pages latest | |
| mike set-default --push --remote origin --branch gh-pages latest |