From 577ba4c775cc52002f4f4bf196a39478ecfac383 Mon Sep 17 00:00:00 2001 From: Ryan Cheung Date: Fri, 20 Feb 2026 19:39:12 -0800 Subject: [PATCH] fix(docs): respect SITE_URL env var in mkdocs config for correct site: link resolution --- .github/workflows/docs.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index e709f108..d95e9f65 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -156,8 +156,22 @@ jobs: # Extract the date (e.g., release/2026-01-11 -> 2026-01-11) VERSION_NAME=${GITHUB_REF#refs/heads/release/} - # Deploy this version, tag it as 'latest', and set it as the default site root - uv run mike deploy --push --update-aliases $VERSION_NAME latest + # Fetch all release branches to determine if this is the latest + git fetch origin "+refs/heads/release/*:refs/remotes/origin/release/*" + + # Find the highest version number among all release branches + LATEST_VERSION=$(git branch -r --list "origin/release/*" | sed 's|origin/release/||' | sort -V | tail -n 1 | tr -d ' ') + + echo "Deploying version: $VERSION_NAME" + echo "Latest detected version: $LATEST_VERSION" + + if [ "$VERSION_NAME" = "$LATEST_VERSION" ]; then + echo "This is the latest version. Updating 'latest' alias." + uv run mike deploy --push --update-aliases "$VERSION_NAME" latest + else + echo "This is NOT the latest version. Deploying without updating 'latest' alias." + uv run mike deploy --push "$VERSION_NAME" + fi - name: Create GitHub Release and Tag if: startsWith(github.ref, 'refs/heads/release/')