99 PYMAPDL_DB_PORT : 21001 # default won't work on GitHub runners
1010 PYMAPDL_START_INSTANCE : FALSE
1111 DOCKER_PACKAGE : ghcr.io/pyansys/pymapdl/mapdl
12+ DOCUMENTATION_CNAME : reader.docs.pyansys.com
1213
1314on :
1415 pull_request :
@@ -24,55 +25,30 @@ concurrency:
2425
2526jobs :
2627 doc_build :
27- name : Build Documentation
28+ name : Build documentation
2829 runs-on : ubuntu-latest
29-
3030 steps :
31- - uses : actions/checkout@v3
32-
33- - name : Setup Python
34- uses : actions/setup-python@v4
35- with :
36- python-version : " 3.10"
37-
3831 - name : Setup headless display
3932 uses : pyvista/setup-headless-display-action@v2
4033
41- - name : Install ansys-mapdl-reader
42- run : |
43- pip install -e .
44- cd tests/
45- python -c "from ansys.mapdl import reader as pymapdl_reader; print(pymapdl_reader.Report())"
46-
47- - name : Install OS packages
48- run : |
49- sudo apt-get update
50- sudo apt-get install zip pandoc -qy
51-
52- - name : Build Documentation
53- run : |
54- pip install -r requirements/requirements_docs.txt --disable-pip-version-check
55- make -C doc html
56- cd doc/build/html/
57- zip -r ../../../${{ env.PACKAGE_NAME }}-HTML.zip ./*
58-
59- - name : Upload
60- uses : actions/upload-artifact@v3
34+ - name : Build project documentation
35+ uses : ansys/actions/doc-build@v4
6136 with :
62- name : ${{ env.PACKAGE_NAME }}-Documentation
63- path : |
64- ${{ env.PACKAGE_NAME }}-HTML.zip
65- doc/build/latex/*.pdf
66- retention-days : 7
37+ dependencies : ' pandoc'
38+ skip-dependencies-cache : true
39+ use-python-cache : false
40+ python-version : " 3.10"
6741
68- - name : Deploy
69- uses : JamesIves/github-pages-deploy-action@v4
70- if : startsWith(github.ref, 'refs/tags/')
42+ doc-deploy-dev :
43+ name : Upload development documentation
44+ runs-on : ubuntu-latest
45+ needs : [doc_build]
46+ if : github.ref == 'refs/heads/main'
47+ steps :
48+ - uses : ansys/actions/doc-deploy-dev@v4
7149 with :
50+ cname : ${{ env.DOCUMENTATION_CNAME }}
7251 token : ${{ secrets.GITHUB_TOKEN }}
73- branch : gh-pages
74- folder : doc/build/html
75- clean : true
7652
7753 build :
7854 name : Build and Test
@@ -262,6 +238,12 @@ jobs:
262238 - name : Display structure of downloaded files
263239 run : ls -R
264240
241+ - name : Compressing HTML documentation
242+ 243+ with :
244+ files : documentation-html
245+ dest : documentation-html.zip
246+
265247 - name : Upload to Public PyPi
266248 run : |
267249 pip install twine
@@ -279,3 +261,15 @@ jobs:
279261 ./**/*.whl
280262 ./**/*.zip
281263 ./**/*.pdf
264+
265+ doc-deploy-release :
266+ name : Upload release documentation
267+ if : github.event_name == 'push' && contains(github.ref, 'refs/tags')
268+ runs-on : ubuntu-latest
269+ needs : [Release]
270+ steps :
271+ - name : Deploy the stable documentation
272+ uses : ansys/actions/doc-deploy-stable@v4
273+ with :
274+ cname : ${{ env.DOCUMENTATION_CNAME }}
275+ token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments