Skip to content

Commit 577ba4c

Browse files
committed
fix(docs): respect SITE_URL env var in mkdocs config for correct site: link resolution
1 parent 97d19c3 commit 577ba4c

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

.github/workflows/docs.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,22 @@ jobs:
156156
# Extract the date (e.g., release/2026-01-11 -> 2026-01-11)
157157
VERSION_NAME=${GITHUB_REF#refs/heads/release/}
158158
159-
# Deploy this version, tag it as 'latest', and set it as the default site root
160-
uv run mike deploy --push --update-aliases $VERSION_NAME latest
159+
# Fetch all release branches to determine if this is the latest
160+
git fetch origin "+refs/heads/release/*:refs/remotes/origin/release/*"
161+
162+
# Find the highest version number among all release branches
163+
LATEST_VERSION=$(git branch -r --list "origin/release/*" | sed 's|origin/release/||' | sort -V | tail -n 1 | tr -d ' ')
164+
165+
echo "Deploying version: $VERSION_NAME"
166+
echo "Latest detected version: $LATEST_VERSION"
167+
168+
if [ "$VERSION_NAME" = "$LATEST_VERSION" ]; then
169+
echo "This is the latest version. Updating 'latest' alias."
170+
uv run mike deploy --push --update-aliases "$VERSION_NAME" latest
171+
else
172+
echo "This is NOT the latest version. Deploying without updating 'latest' alias."
173+
uv run mike deploy --push "$VERSION_NAME"
174+
fi
161175
162176
- name: Create GitHub Release and Tag
163177
if: startsWith(github.ref, 'refs/heads/release/')

0 commit comments

Comments
 (0)