Add docs version support
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
This commit is contained in:
parent
d7590f06d9
commit
a5d3cfbe8a
2 changed files with 28 additions and 2 deletions
27
.github/workflows/docs.yml
vendored
27
.github/workflows/docs.yml
vendored
|
|
@ -7,6 +7,9 @@ on:
|
||||||
paths:
|
paths:
|
||||||
- 'docs/**'
|
- 'docs/**'
|
||||||
- 'mkdocs.yml'
|
- 'mkdocs.yml'
|
||||||
|
release:
|
||||||
|
types:
|
||||||
|
- published
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
|
|
@ -17,11 +20,31 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: 3.x
|
python-version: 3.x
|
||||||
|
|
||||||
- run: pip install mkdocs-material
|
- run: pip install mkdocs-material mike
|
||||||
|
|
||||||
- run: mkdocs gh-deploy --force
|
- name: Configure git user
|
||||||
|
run: |
|
||||||
|
git config user.name "github-actions[bot]"
|
||||||
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
|
|
||||||
|
- name: Deploy dev docs (push to main)
|
||||||
|
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
|
||||||
|
run: |
|
||||||
|
PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version --quiet -DforceStdout)
|
||||||
|
mike deploy --push --update-aliases "${PROJECT_VERSION}" dev
|
||||||
|
# mike deploy --push --update-aliases dev
|
||||||
|
# mike set-default dev --push
|
||||||
|
|
||||||
|
- name: Deploy versioned docs (release)
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
run: |
|
||||||
|
VERSION=${GITHUB_REF_NAME}
|
||||||
|
mike deploy --push --update-aliases "${VERSION}" latest
|
||||||
|
mike set-default latest --push
|
||||||
|
|
|
||||||
|
|
@ -86,6 +86,9 @@ plugins:
|
||||||
- blog
|
- blog
|
||||||
|
|
||||||
extra:
|
extra:
|
||||||
|
version:
|
||||||
|
provider: mike
|
||||||
|
alias: true
|
||||||
social:
|
social:
|
||||||
- icon: fontawesome/brands/github
|
- icon: fontawesome/brands/github
|
||||||
link: https://github.com/modelcontextprotocol/java-sdk
|
link: https://github.com/modelcontextprotocol/java-sdk
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue