-
Notifications
You must be signed in to change notification settings - Fork 128
131 lines (113 loc) · 4.38 KB
/
nightly-docs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Nightly Documentation Build
on:
workflow_dispatch:
schedule: # UTC at 0300
- cron: '0 3 * * *'
env:
ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }}
MAIN_PYTHON_VERSION: '3.10'
DOCUMENTATION_CNAME: 'aedt.docs.pyansys.com'
MEILISEARCH_API_KEY: ${{ secrets.MEILISEARCH_API_KEY }}
MEILISEARCH_HOST_URL: ${{ vars.MEILISEARCH_HOST_URL }}
MEILISEARCH_PUBLIC_API_KEY: ${{ secrets.MEILISEARCH_PUBLIC_API_KEY }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
doc-build:
name: Documentation build with examples
runs-on: [ self-hosted, Windows, pyaedt ]
timeout-minutes: 720
steps:
- name: Install Git and checkout project
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
- name: Create virtual environment
run: |
python -m venv .venv
.venv\Scripts\Activate.ps1
python -m pip install pip -U
python -m pip install wheel setuptools -U
python -c "import sys; print(sys.executable)"
- name: Install pyaedt and documentation dependencies
run: |
.venv\Scripts\Activate.ps1
pip install .[doc]
- name: Retrieve PyAEDT version
id: version
run: |
.venv\Scripts\Activate.ps1
echo "PYAEDT_VERSION=$(python -c 'from pyaedt import __version__; print(__version__)')" >> $GITHUB_OUTPUT
echo "PyAEDT version is: $(python -c "from pyaedt import __version__; print(__version__)")"
- name: Install CI dependencies (e.g. vtk-osmesa)
run: |
.venv\Scripts\Activate.ps1
# Uninstall conflicting dependencies
pip uninstall --yes vtk
pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0
# TODO: Update this step once pyaedt-examples is ready
# NOTE: Use environment variable to keep the doctree and avoid redundant build for PDF pages
- name: Build HTML documentation with examples
env:
SPHINXBUILD_KEEP_DOCTREEDIR: "1"
run: |
.venv\Scripts\Activate.ps1
.\doc\make.bat clean
.\doc\make.bat html
# TODO: Keeping this commented as reminder of https://github.com/ansys/pyaedt/issues/4296
# # Verify that sphinx generates no warnings
# - name: Check for warnings
# run: |
# .venv\Scripts\Activate.ps1
# python doc/print_errors.py
# Use environment variable to remove the doctree after the build of PDF pages
- name: Build PDF documentation with examples
env:
SPHINXBUILD_KEEP_DOCTREEDIR: "0"
run: |
.venv\Scripts\Activate.ps1
.\doc\make.bat pdf
# - name: Add assets to HTML docs
# run: |
# zip -r documentation-html.zip ./doc/_build/html
# mv documentation-html.zip ./doc/_build/html/_static/assets/download/
# cp doc/_build/latex/PyAEDT-Documentation-*.pdf ./doc/_build/html/_static/assets/download/pyaedt.pdf
- name: Upload HTML documentation with examples artifact
uses: actions/upload-artifact@v3
with:
name: documentation-html
path: doc/_build/html
retention-days: 7
- name: Upload PDF documentation without examples artifact
uses: actions/upload-artifact@v3
with:
name: documentation-pdf
path: doc/_build/latex/PyAEDT-Documentation-*.pdf
retention-days: 7
upload-dev-doc:
name: Upload dev documentation
runs-on: ubuntu-latest
needs: doc-build
steps:
- name: Upload development documentation
uses: ansys/actions/doc-deploy-dev@v4
with:
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.GITHUB_TOKEN }}
doc-artifact-name: 'documentation-html'
doc-index-dev:
name: Deploy dev index docs
runs-on: ubuntu-latest
needs: upload-dev-doc
steps:
- name: Deploy the latest documentation index
uses: ansys/actions/doc-deploy-index@v4
with:
cname: ${{ env.DOCUMENTATION_CNAME }}/version/dev
index-name: pyaedt-vdev
host-url: ${{ env.MEILISEARCH_HOST_URL }}
api-key: ${{ env.MEILISEARCH_API_KEY }}
python-version: ${{ env.MAIN_PYTHON_VERSION }}