Add docs version support
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
This commit is contained in:
parent
d7590f06d9
commit
a5d3cfbe8a
1 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:
|
||||
- 'docs/**'
|
||||
- 'mkdocs.yml'
|
||||
release:
|
||||
types:
|
||||
- published
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
|
|
@ -17,11 +20,31 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
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
|
||||
|
|
|
|||
Loading…
Reference in a new issue