Skip to content

Commit

Permalink
doc: Introduce mike for versioned doc (#270)
Browse files Browse the repository at this point in the history
* Doc: Introduce mike for versioned doc
  • Loading branch information
gmuloc authored Jul 12, 2023
1 parent d4c4053 commit 21c90ee
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 36 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/devel-doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
# This is deploying the latest commits on master to devel documentation
name: Mkdocs
on:
push:
branches:
- master
paths:
# Run only if any of the following paths are changed when pushing to master
# May need to update this
- "docs/**"
- "mkdocs.yml"

jobs:
'build_latest_doc':
name: 'Update Public devel documentation'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: 'Setup Python 3 on runner'
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Setup Git config
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: 'Build mkdocs content and deploy to gh-pages to devel'
run: |
pip install -r ./docs/requirements.txt
mike deploy --push devel
# This may not always be required
mike set-default --push devel
29 changes: 24 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,31 @@
---
name: "Tag & Release management"
on:
workflow_dispatch:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v[0-9]+.[0-9]+.[0-9]+' # Push events to matching v*, i.e. v1.0, v20.15.10
release:
types:
- published

jobs:
release-doc:
name: "Publish documentation for release ${{github.ref_name}}"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: 'Setup Python 3 on runner'
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Setup Git config
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: 'Build mkdocs content to site folder'
run: |
pip install -r ./docs/requirements.txt
mike deploy --update-alias --push ${{github.ref_name}} stable
pypi:
name: Publish version to Pypi servers
runs-on: ubuntu-latest
Expand Down
30 changes: 0 additions & 30 deletions .github/workflows/website.yml

This file was deleted.

3 changes: 2 additions & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ mkdocs-material-extensions>=1.0.3
mkdocstrings>=0.19.0
mkdocstrings-python>=0.7.1
mdx_truly_sane_lists
fontawesome_markdown
fontawesome_markdown
mike==1.1.2
3 changes: 3 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ extra:
link: https://github.com/arista-netdevops-community/anta/pkgs/container/network-test-automation
- icon: fontawesome/brands/python
link: https://pypi.org/project/anta/
version:
provider: mike

extra_css:
- stylesheets/extra.material.css
Expand Down Expand Up @@ -87,6 +89,7 @@ plugins:
lang: en
- git-revision-date-localized:
type: date
- mike:

markdown_extensions:
- attr_list
Expand Down

0 comments on commit 21c90ee

Please sign in to comment.