Skip to content

Commit 42887a8

Browse files
committed
docs version management improvements
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
1 parent af25e25 commit 42887a8

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

.github/workflows/docs.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,21 @@ jobs:
3434
git config user.name "github-actions[bot]"
3535
git config user.email "github-actions[bot]@users.noreply.github.com"
3636
37-
- name: Deploy dev docs (push to main)
37+
- name: Deploy docs (push to main)
3838
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
3939
run: |
4040
PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version --quiet -DforceStdout)
41-
mike deploy --push --update-aliases "${PROJECT_VERSION}" dev
42-
# mike deploy --push --update-aliases dev
43-
# mike set-default dev --push
41+
if [[ "${PROJECT_VERSION}" == *-SNAPSHOT ]]; then
42+
ALIAS="dev"
43+
else
44+
ALIAS="prod"
45+
fi
46+
mike deploy --push --update-aliases "${PROJECT_VERSION}" "${ALIAS}"
47+
mike set-default "${ALIAS}" --push
4448
4549
- name: Deploy versioned docs (release)
4650
if: github.event_name == 'release'
4751
run: |
4852
VERSION=${GITHUB_REF_NAME}
49-
mike deploy --push --update-aliases "${VERSION}" latest
50-
mike set-default latest --push
53+
mike deploy --push --update-aliases "${VERSION}" release
54+
mike set-default release --push

mkdocs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ extra:
9292
default:
9393
- dev
9494
- latest
95+
- prod
96+
- release
9597
social:
9698
- icon: fontawesome/brands/github
9799
link: https://github.com/modelcontextprotocol/java-sdk

0 commit comments

Comments
 (0)