mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-10-26 02:48:59 -04:00
Add versioning to docs using 'mike'
This commit is contained in:
parent
5db04b4b5f
commit
3a034712f6
3 changed files with 38 additions and 13 deletions
42
.github/workflows/mkdocs.yml
vendored
42
.github/workflows/mkdocs.yml
vendored
|
|
@ -3,21 +3,43 @@ on:
|
|||
push:
|
||||
branches:
|
||||
- master
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
- name: Configure Git Credentials
|
||||
run: |
|
||||
git config user.name github-actions[bot]
|
||||
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: 3.x
|
||||
- run: pip install --no-cache-dir mkdocs mkdocs-material pymdown-extensions
|
||||
working-directory: ./mkdocs
|
||||
- run: mkdocs gh-deploy --force
|
||||
working-directory: ./mkdocs
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
|
||||
- name: Install dependencies
|
||||
working-directory: ./mkdocs
|
||||
run: |
|
||||
pip install --no-cache-dir mkdocs mkdocs-material pymdown-extensions mike
|
||||
|
||||
- name: Deploy docs
|
||||
working-directory: ./mkdocs
|
||||
env:
|
||||
REF_TYPE: ${{ github.ref_type }}
|
||||
REF_NAME: ${{ github.ref_name }}
|
||||
run: |
|
||||
if [ "$REF_TYPE" = "tag" ]; then
|
||||
mike deploy --push --update-aliases "$REF_NAME" latest
|
||||
mike set-default --push latest
|
||||
elif [ "$REF_TYPE" = "branch" ] && [ "$REF_NAME" = "master" ]; then
|
||||
mike deploy --push master
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@
|
|||
```bash
|
||||
python3 -m venv venv
|
||||
source venv/bin/activate
|
||||
pip3 install --no-cache-dir mkdocs mkdocs-material pymdown-extensions
|
||||
mkdocs serve
|
||||
pip3 install --no-cache-dir mkdocs mkdocs-material pymdown-extensions mike
|
||||
mike serve
|
||||
```
|
||||
|
||||
## References
|
||||
|
|
|
|||
|
|
@ -7,7 +7,10 @@ edit_uri: edit/master/mkdocs/docs/
|
|||
docs_dir: docs
|
||||
plugins:
|
||||
- search
|
||||
- tags
|
||||
- mike
|
||||
extra:
|
||||
version:
|
||||
provider: mike
|
||||
theme:
|
||||
name: material
|
||||
logo: logo.png
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue