Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/documentation-deploy-development.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build/Publish Latest Develop Docs

permissions: write-all

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:

jobs:
build-docs-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.13

- name: Install dependencies
run: |
pip install ".[doc]"
- name: Setup Docs Deploy user
run: |
git config --global user.name "Docs Deploy"
git config --global user.email "docs.deploy@example.co.uk"
- name: Deploy mkdocs on GitHub Pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG_NAME=${{ github.ref_name }}
MAJ_MIN_VERSION=${TAG_NAME%/*}
echo $MAJ_MIN_VERSION
mike deploy --push develop
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: documentation-deploy
name: Build/Publish Latest Release Docs

permissions: write-all

Expand All @@ -11,17 +11,24 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.13

- name: Install dependencies
run: |
pip install ".[doc]"
pip install ".[doc]"
- name: Setup Docs Deploy user
run: |
git config --global user.name "Docs Deploy"
git config --global user.email "docs.deploy@example.co.uk"
- name: Deploy mkdocs on GitHub Pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mkdocs gh-deploy --force
TAG_NAME=${{ github.event.release.tag_name }}
MAJ_MIN_VERSION=${TAG_NAME%.*}
mike deploy --push --update-aliases $MAJ_MIN_VERSION latest
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ coverage.xml
.tox

docs/_build
site

# ide
.idea
Expand Down
4 changes: 4 additions & 0 deletions README.dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ mkdocs serve

This will return a URL (e.g. `http://127.0.0.1:8000/mibitrans/`) where the docs site can be viewed.

Note that this will only create the "non-versioned" documentation, which should be fine for testing changes to the docs.
The versioned documentation is created using the python utility called [mike](https://github.com/jimporter/mike?tab=readme-ov-file#mike) and its corresponding [mkdocs integration](https://squidfunk.github.io/mkdocs-material/setup/setting-up-versioning/).
In general it should not be necessary to test this, but if necessary, use [the mike documentation](https://github.com/jimporter/mike?tab=readme-ov-file#viewing-your-docs) to inspect locally.

## Versioning

Bumping the version across all files is done with [bump-my-version](https://github.com/callowayproject/bump-my-version), e.g.
Expand Down
4 changes: 4 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,7 @@ extra:
social:
- icon: fontawesome/brands/github
link: https://github.com/MiBiPreT/mibitrans
version:
provider: mike
default: latest
alias: true
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ doc = [
"mkdocstrings[python] ==0.27.0",
"mdx-include >=1.4.1",
"mkdocs-markdownextradata-plugin >=0.2.5",
"mike >=2.1.3"
]

[project.urls]
Expand Down