@@ -143,10 +143,57 @@ jobs:
143143 run : pip list
144144
145145 - name : " Build HTML Documentation"
146- shell : cmd /D /E:ON /V:OFF /C "CALL "{0}""
147- working-directory : .ci
146+ shell : bash
148147 run : |
149- build_doc.bat > ..\doc\log.txt && type ..\doc\log.txt 2>&1
148+ # Navigate to the documentation directory
149+ cd doc
150+
151+ # Create a log file for output redirection
152+ LOG_FILE="../doc/log.txt"
153+ exec > >(tee -a "$LOG_FILE") 2>&1
154+
155+ echo "Starting documentation build process..."
156+
157+ # Backup files from source/examples and source/_temp/plugins before cleaning
158+ echo "Backing up files before cleaning..."
159+ mkdir -p source/_backup
160+ [ -d "source/examples/07-python-operators/plugins" ] && cp -r source/examples/07-python-operators/plugins source/_backup/plugins || true
161+ [ -d "source/examples/04-advanced/02-volume_averaged_stress" ] && cp -r source/examples/04-advanced/02-volume_averaged_stress source/_backup/04_advanced || true
162+ [ -d "source/examples/12-fluids/02-fluids_results" ] && cp -r source/examples/12-fluids/02-fluids_results source/_backup/12_fluids || true
163+
164+ # Clean previous builds
165+ echo "Cleaning previous build artifacts..."
166+ rm -rf build source/images/auto-generated source/examples
167+ rm -rf source/_temp || true
168+
169+ # Restore backed-up files
170+ echo "Restoring backed-up files..."
171+ mkdir -p source/examples/07-python-operators
172+ [ -d "source/_backup/plugins" ] && cp -r source/_backup/plugins source/examples/07-python-operators/plugins || true
173+ mkdir -p source/examples/04-advanced
174+ [ -d "source/_backup/04_advanced" ] && cp -r source/_backup/04_advanced source/examples/04-advanced/02-volume_averaged_stress || true
175+ mkdir -p source/examples/12-fluids
176+ [ -d "source/_backup/12_fluids" ] && cp -r source/_backup/12_fluids source/examples/12-fluids/02-fluids_results || true
177+ rm -rf source/_backup || true
178+
179+ # Build the HTML documentation
180+ echo "Building HTML documentation..."
181+ sphinx-build -b html source build/html -v
182+
183+ # Copy necessary images to the build directory
184+ echo "Copying images for patching pyVista issues..."
185+ mkdir -p build/html/_images
186+ cp -v source/examples/04-advanced/02-volume_averaged_stress/sphx_glr_02-volume_averaged_stress_001.png build/html/_images/ || true
187+ cp -v source/examples/12-fluids/02-fluids_results/sphx_glr_02-fluids_results_00*.png build/html/_images/ || true
188+ cp -v source/examples/12-fluids/02-fluids_results/sphx_glr_02-fluids_results_thumb.png build/html/_images/ || true
189+
190+ # Verify the output
191+ echo "Documentation build completed. Verifying contents..."
192+ ls -R build/html
193+
194+ # Display the log file content
195+ echo "Displaying the log file content..."
196+ cat "$LOG_FILE"
150197 timeout-minutes : 60
151198 env :
152199 MEILISEARCH_PUBLIC_API_KEY : ${{ secrets.MEILISEARCH_PUBLIC_API_KEY }}
0 commit comments