Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add workflow for mkdocs (by versions using mike) #596

Merged
merged 3 commits into from
Jun 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Publish docs via GitHub Pages
on:
push:
branches:
- main
paths:
- "docs/**"
- "mkdocs.yml"

release:
types:
- published

env:
PYTHON_VERSION: 3.x

jobs:
build:
name: Deploy docs
runs-on: ubuntu-latest
steps:
- name: Checkout main
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v3
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install mike==1.1.2 mkdocs-material==8.3.2

- name: git config
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"

- name: mike deploy main
if: contains(github.ref, 'refs/heads/main')
run: |
mike deploy --push main

- name: mike deploy new version
if: contains(github.ref, 'refs/tags/v') && !github.event.release.prerelease
run: |
VERSION=${GITHUB_REF/refs\/tags\//}
mike deploy --rebase --push --update-aliases "${VERSION}" latest
3 changes: 3 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,6 @@ markdown_extensions:
permalink: true
plugins:
- search
extra:
version:
provider: mike