trapexit
2 days ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with
38 additions and
13 deletions
-
.github/workflows/mkdocs.yml
-
mkdocs/README.md
-
mkdocs/mkdocs.yml
|
|
@ -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 |
|
|
|
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: mkdocs gh-deploy --force |
|
|
|
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 |
|
|
|