java-sdk/.github/workflows/docs.yml
Christian Tzolov 5ebe61617b Another round of improving mkdocs docs
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
2026-02-16 14:20:13 +01:00

54 lines
1.4 KiB
YAML

name: Deploy Documentation
on:
push:
branches:
- main
paths:
- 'docs/**'
- 'mkdocs.yml'
release:
types:
- published
workflow_dispatch:
permissions:
contents: write
jobs:
deploy:
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 mike
- 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 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)
if [[ "${PROJECT_VERSION}" == *-SNAPSHOT ]]; then
ALIAS="latest-snapshot"
else
ALIAS="latest"
fi
mike deploy --push --update-aliases "${PROJECT_VERSION}" "${ALIAS}"
mike set-default "${ALIAS}" --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