11name : " 📚 Build documentation and deploy "
2-
32on :
4- workflow_dispatch :
3+ workflow_dispatch : # Able to not use cache by user demand
4+ inputs :
5+ cache :
6+ description : " Use build cache"
7+ required : false
8+ default : " true"
9+
10+
11+ concurrency :
12+ group : ${{ github.workflow }}-${{ github.ref }}
13+ cancel-in-progress : true
14+
15+ env :
16+ USE_CACHE : ${{ (github.event_name == 'workflow_dispatch' && github.event.inputs.cache == 'true') }}
17+ PYDEVD_DISABLE_FILE_VALIDATION : " 1"
18+ PYTEST_ADDOPTS : " --color=yes"
19+ FORCE_COLOR : " True"
520
621jobs :
7- documentation :
8- runs-on : ubuntu-latest
22+ doc :
23+ name : Build Documentation
24+ runs-on : ubuntu-20.04
25+ env :
26+ PYVISTA_OFF_SCREEN : " True"
27+ ALLOW_PLOTTING : true
28+ SHELLOPTS : " errexit:pipefail"
929 steps :
1030 - uses : actions/checkout@v4
11- - run : |
12- cp CHANGELOG.md docs/source/getting_started/CHANGELOG.md
13- docker build . -t=lsdocs -f docs/Dockerfile
14- docker run -v $(pwd):/LoopStructural lsdocs bash LoopStructural/docs/build_docs.sh
15- - name : upload artifacts
16- uses : actions/upload-artifact@v3
31+
32+ - uses : actions/setup-python@v5
33+ with :
34+ python-version : " 3.12"
35+ cache : " pip"
36+
37+ - uses : awalsh128/cache-apt-pkgs-action@v1.1.3
38+ with :
39+ packages : libosmesa6-dev libgl1-mesa-dev python3-tk pandoc git-restore-mtime
40+ version : 3.0
41+
42+ - name : Install PyVista and dependencies
43+ run : |
44+ pip install -e .[docs]
45+
46+ - name : Install custom OSMesa VTK variant
47+ run : |
48+ pip uninstall vtk -y
49+ pip install vtk-osmesa==9.3.0 --index-url https://gitlab.kitware.com/api/v4/projects/13/packages/pypi/simple
50+
51+
52+
53+ - name : Build Documentation
54+ run : make -C docs html
55+
56+ - name : Dump Sphinx Warnings and Errors
57+ if : always()
58+ run : if [ -e doc/sphinx_warnings.txt ]; then cat doc/sphinx_warnings.txt; fi
59+
60+ - name : Dump VTK Warnings and Errors
61+ if : always()
62+ run : if [ -e doc/errors.txt ]; then cat doc/errors.txt; fi
63+
64+
65+
66+
67+
68+ - name : Upload HTML documentation
69+ if : always()
70+ uses : actions/upload-artifact@v4
71+ with :
72+ name : docs-build
73+ path : docs/build/html/
74+
75+ - uses : actions/upload-artifact@v4
76+ with :
77+ name : examples
78+ path : docs/source/_auto_examples/
79+
80+ - name : Get Notebooks
81+ run : |
82+ mkdir _notebooks
83+ find docs/source/_auto_examples -type f -name '*.ipynb' | cpio -p -d -v _notebooks/
84+
85+ - uses : actions/upload-artifact@v4
1786 with :
18- path : docs/build/html
87+ name : loopstructural-notebooks
88+ path : _notebooks
89+
1990 - name : Deploy 🚀
2091 uses : JamesIves/github-pages-deploy-action@4.1.3
2192 with :
2293 branch : gh-pages # The branch the action should deploy to.
2394 folder : docs/build/html # The folder the action should deploy.
24-
25-
95+
0 commit comments