Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 6 additions & 19 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,16 @@ name: Deploy Documentation

on:
# Trigger after the test workflow completes successfully
# workflow_run:
# workflows: ["Unit Tests"]
# types:
# - completed
# branches:
# - main
workflow_run:
workflows: ["Unit Tests"]
types:
- completed
branches:
- main

# Allow manual deployment
workflow_dispatch:

# Temporarily trigger on push for testing
push:
branches:
- main

jobs:
check-conditions:
name: Check Deployment Conditions
Expand All @@ -38,13 +33,6 @@ jobs:
exit 0
fi

# Temporarily allow push events for testing
if [[ "${{ github.event_name }}" == "push" ]]; then
echo "✅ Conditions met: push to main (testing mode)"
echo "should_deploy=true" >> $GITHUB_OUTPUT
exit 0
fi

# Check if triggered by successful push to main
if [[ "${{ github.event.workflow_run.conclusion }}" == "success" && \
"${{ github.event.workflow_run.event }}" == "push" ]]; then
Expand Down Expand Up @@ -84,7 +72,6 @@ jobs:
- name: Install dependencies
run: uv sync

# Temporarily skip coverage download when testing without workflow_run trigger
- name: Download coverage artifact from test workflow
if: github.event_name == 'workflow_run'
# Download coverage artifact from the workflow_run that triggered this
Expand Down
29 changes: 27 additions & 2 deletions .github/workflows/deploy-pr-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,35 @@ jobs:
mkdir -p "pr-${PR_NUMBER}/coverage"
rsync -avr pr-source/tests/coverage/ "pr-${PR_NUMBER}/coverage/"
fi

# Update switcher.json in all version directories
# This ensures all versions have the latest switcher with all available versions
echo "Updating switcher.json in all version directories..."
for dir in */; do
# Only process directories that look like version directories (X.Y.Z, latest, pr-N)
# Skip: _build, docs, nexusLIMS (source code), and hidden dirs
if [ -d "$dir" ] && [ "$dir" != "_build/" ] && \
[ "$dir" != "docs/" ] && [ "$dir" != "nexusLIMS/" ] && \
[[ ! "$dir" =~ ^\. ]]; then
# Check if this looks like a docs directory (has _static subdirectory)
dir_clean="${dir%/}"
if [ -d "$dir_clean/_static" ]; then
mkdir -p "$dir_clean/_static"
cp pr-source/docs/_static/switcher.json "$dir_clean/_static/switcher.json"
echo " Updated switcher.json in $dir"
fi
fi
done

git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add "pr-${PR_NUMBER}"
git commit -m "Deploy docs preview for PR #${PR_NUMBER}" || echo "No changes to commit"

# Commit and push - add all changes in documentation directories
git add -A "pr-${PR_NUMBER}/" 2>/dev/null || true
git add -A latest/ 2>/dev/null || true
git add -A [0-9]*/ 2>/dev/null || true
git add -A pr-*/ 2>/dev/null || true
git commit -m "Deploy docs preview for PR #${PR_NUMBER} and update switcher.json" || echo "No changes to commit"
git pull --rebase origin gh-pages
git push origin gh-pages
echo "✅ Documentation preview deployed!"
Expand Down
1 change: 1 addition & 0 deletions docs/changes/5.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed documentation version switcher to use full semantic version numbers (e.g., ``2.1.0``) instead of major.minor versions (e.g., ``2.1``), and properly highlight the current version being viewed. The switcher now shows only the most recent patch version for each minor release and marks the highest version as stable.
Loading