Skip to content

Commit

Permalink
Set up versioning with mkdocs (#850)
Browse files Browse the repository at this point in the history
  • Loading branch information
nickdnk committed Aug 20, 2022
1 parent 112b52b commit 951ff14
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 9 deletions.
23 changes: 14 additions & 9 deletions .github/workflows/generate_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,17 @@ jobs:
steps:
- name: Checkout main
uses: actions/checkout@v2

- name: Deploy docs
uses: mhausenblas/mkdocs-deploy-gh-pages@master
# Or use mhausenblas/mkdocs-deploy-gh-pages@nomaterial to build without the mkdocs-material theme
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CONFIG_FILE: documentation/mkdocs.yml
EXTRA_PACKAGES: build-base
REQUIREMENTS: documentation/requirements.txt
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- run: |
cd documentation
pip install -r requirements.txt
git config user.name docs && git config user.email [email protected]
git fetch origin gh-pages --depth=1
if [ ${{ github.ref }} == 'refs/heads/master' ]
then
mike deploy latest --push
else
mike deploy dev --push
fi
10 changes: 10 additions & 0 deletions documentation/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ theme:
name: Switch to light mode
plugins:
- swagger-ui-tag
- mike:
# These fields are all optional; the defaults are as below...
canonical_version: null
version_selector: true
css_dir: css
javascript_dir: js
nav:
- Home: index.md
- Setup:
Expand Down Expand Up @@ -59,3 +65,7 @@ markdown_extensions:
extra_javascript:
- https://unpkg.com/[email protected]/dist/tablesort.min.js
- javascripts/tablesort.js
extra:
version:
default: latest
provider: mike
3 changes: 3 additions & 0 deletions documentation/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
mkdocs-swagger-ui-tag==0.3.0
mkdocs
mkdocs-material
mike

0 comments on commit 951ff14

Please sign in to comment.