@@ -103,8 +103,6 @@ jobs:
103103 run : pip install -r requirements.txt
104104
105105 - name : Build html documentation
106- env :
107- SPHINXOPTS : " -W --keep-going"
108106 run : cd ${{ matrix.manual.directory }} && make ${{ matrix.manual.make_target }}
109107
110108 - name : Compute release version
@@ -185,58 +183,74 @@ jobs:
185183 run : |
186184 current_branch="${GITHUB_REF#refs/heads/}"
187185
186+ # Find the highest numbered stable branch from the remote
188187 highest_stable=$(git ls-remote --heads origin | sed -n 's?.*refs/heads/stable\([0-9]\{2\}\)$?\1?p' | sort -n | tail -1)
189188 highest_stable_branch="stable${highest_stable}"
190189
191190 echo "Current branch: $current_branch"
192191 echo "Highest stable branch found: $highest_stable_branch"
193192
193+ # Map actual branch names to deployment folder names
194194 case "$current_branch" in
195195 "master")
196196 echo "branch_name=latest" >> $GITHUB_OUTPUT
197197 ;;
198198 "$highest_stable_branch")
199199 echo "branch_name=stable" >> $GITHUB_OUTPUT
200+ # Also record the numeric version so we can publish to server/<number>/ too
200201 echo "version_name=${highest_stable}" >> $GITHUB_OUTPUT
201202 ;;
202203 *)
204+ # Remove stable prefix for current branch
203205 current_branch="${current_branch#stable}"
204206 echo "branch_name=$current_branch" >> $GITHUB_OUTPUT
205207 ;;
206208 esac
207209
208- - name : Merge artifacts into gh-pages layout
210+ echo "Deployment folder name: ${{ steps.branch.outputs.branch_name }}"
211+ echo "Version name for additional deployment (if applicable): ${{ steps.branch.outputs.version_name }}"
212+
213+ - name : Merge ${{ steps.branch.outputs.branch_name }} documentation artifacts into gh-pages
209214 run : |
215+ # List artifacts
210216 ls -la artifacts/*/
211217
218+ # Cleanup old documentation
219+ rm -rf ${{ steps.branch.outputs.branch_name }}
212220 rm -rf server/${{ steps.branch.outputs.branch_name }}
213221 mkdir -p server/${{ steps.branch.outputs.branch_name }}
214222
223+ # Copy all built documentation into dedicated subdirectories
215224 for artifact in artifacts/*; do
216225 if [ -d "$artifact" ]; then
217226 manual_name="$(basename "$artifact")"
218- mkdir -p "server/${{ steps.branch.outputs.branch_name }}/$manual_name"
219- cp -r "$artifact/"* "server/${{ steps.branch.outputs.branch_name }}/$manual_name/"
220227 fi
221228 done
222229
230+ # Move pdf files to the root of the branch_name
223231 mv server/${{ steps.branch.outputs.branch_name }}/*/*.pdf server/${{ steps.branch.outputs.branch_name }}/ || true
224232
233+ # If this is the highest stable branch, also deploy to its versioned folder
225234 if [ -n "${{ steps.branch.outputs.version_name }}" ]; then
235+ rm -rf server/${{ steps.branch.outputs.version_name }}
226236 cp -r server/${{ steps.branch.outputs.branch_name }} server/${{ steps.branch.outputs.version_name }}
227237 fi
228238
239+ # Cleanup
229240 find . -type d -empty -delete
230241 rm -rf artifacts
231242
232243 - name : Add various redirects for go.php and user_manual english version
233244 run : |
245+ # Fetch source branches so git checkout origin/... works from the gh-pages checkout
234246 git fetch origin ${{ github.event.repository.default_branch }} ${{ github.ref_name }}
235247
248+ # Generate go.php redirect from main branch
236249 git checkout origin/${{ github.event.repository.default_branch }} -- go.php/index.html
237250 mkdir -p server/${{ steps.branch.outputs.branch_name }}/go.php
238251 mv go.php/index.html server/${{ steps.branch.outputs.branch_name }}/go.php/index.html
239252
253+ # Generate user_manual english redirect
240254 git checkout origin/${{ github.ref_name }} -- user_manual/index.html
241255 mkdir -p server/${{ steps.branch.outputs.branch_name }}/user_manual
242256 mv user_manual/index.html server/${{ steps.branch.outputs.branch_name }}/user_manual/index.html
0 commit comments