-
Notifications
You must be signed in to change notification settings - Fork 10
208 lines (178 loc) · 6.86 KB
/
doc.yml
File metadata and controls
208 lines (178 loc) · 6.86 KB
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
name: Build Documentation
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
PYVISTA_OFF_SCREEN: "True"
ALLOW_PLOTTING: true
SHELLOPTS: "errexit:pipefail"
DISPLAY: ":99.0"
jobs:
build-doc:
permissions:
pull-requests: read
issues: read
repository-projects: read
runs-on: ubuntu-latest
strategy:
matrix:
builder: [html, mini18n-html]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: "3.12"
cache: "pip"
- name: Install OS Packages
run: |
sudo apt-get update
sudo apt-get install -yqq libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 libopengl0 libegl1
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1400x900x24 -ac +extension GLX +render -noreset
sudo apt-get update
sudo apt-get install libosmesa6-dev libgl1-mesa-dev python3-tk pandoc git-restore-mtime
sudo apt-get install python3-tk xcb
- name: Install Dependencies
run: |
sudo apt -y install libgeos-dev
pip install -e .[docs]
- name: PyVista Report
run: |
python -c "import pyvista;print(pyvista.Report())"
echo PYVISTA_EXAMPLE_DATA_PATH=$(python -c "from pyvista import examples; print(examples.USER_DATA_PATH)") >> $GITHUB_ENV
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
if: matrix.builder == 'mini18n-html'
with:
repository: pyvista/pyvista-tutorial-translations
path: pyvista-tutorial-translations
fetch-depth: 0
persist-credentials: false
- name: Build Documentation
run: make -C doc ${{ matrix.builder }} SPHINXOPTS="-W --keep-going"
- name: Tar build
run: tar -zcvf doc-build-${{ matrix.builder }}.tar.gz doc/build/
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: doc-build-${{ matrix.builder }}
path: doc-build-${{ matrix.builder }}.tar.gz
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: tutorial-${{ matrix.builder }}
path: doc/source/tutorial
- name: Get Notebooks
run: |
mkdir _notebooks
find doc/source/tutorial -type f -name '*.ipynb' | cpio -p -d -v _notebooks/
find doc/source/tutorial/09_trame -type f -name '*.py' | cpio -p -d -v _notebooks/
rm _notebooks/doc/source/tutorial/09_trame/*.ipynb
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: tutorial-notebooks-${{ matrix.builder }}
path: _notebooks
deploy:
name: Publish Documentation
permissions:
contents: write
pull-requests: read
issues: read
repository-projects: read
runs-on: ubuntu-latest
needs: build-doc
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: doc-build-html
path: .
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: doc-build-mini18n-html
path: .
- name: UnTar build
run: tar -xzvf doc-build-html.tar.gz
- name: UnTar build
run: tar -xzvf doc-build-mini18n-html.tar.gz
- name: Zip Notebooks
run: |
cp -r doc/build/html/notebooks/tutorial/ notebooks
zip -r notebooks.zip notebooks/
mv notebooks.zip doc/build/html/
- name: Copy I18N Documentation
run: find doc/build/mini18n-html -mindepth 1 -maxdepth 1 -type d -exec cp -rf {} doc/build/html/ \;
- name: Deploy to GH Pages
uses: peaceiris/actions-gh-pages@v4 # zizmor: ignore[unpinned-uses]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: doc/build/html
cname: tutorial.pyvista.org
- name: Copy Tutorial Content
run: |
mkdir tutorial-content
cp -r notebooks tutorial-content/notebooks
cp README.md tutorial-content/
cp LICENSE tutorial-content/
cp requirements.txt tutorial-content/
cp start tutorial-content/
cp Dockerfile tutorial-content/
- name: Deploy to Tutorial branch
uses: peaceiris/actions-gh-pages@v4 # zizmor: ignore[unpinned-uses]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: tutorial-content/
publish_branch: tutorial
preview:
name: Preview Documentation
permissions:
contents: write
pull-requests: write
issues: read
repository-projects: read
runs-on: ubuntu-latest
needs: build-doc
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: doc-build-html
path: .
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: doc-build-mini18n-html
path: .
- name: UnTar build
run: tar -xzvf doc-build-html.tar.gz
- name: UnTar build
run: tar -xzvf doc-build-mini18n-html.tar.gz
- name: Zip Notebooks
run: |
cp -r doc/build/html/notebooks/tutorial/ notebooks
zip -r notebooks.zip notebooks/
mv notebooks.zip doc/build/html/
- name: Copy I18N Documentation
run: find doc/build/mini18n-html -mindepth 1 -maxdepth 1 -type d -exec cp -rf {} doc/build/html/ \;
- uses: nwtgck/actions-netlify@4cbaf4c08f1a7bfa537d6113472ef4424e4eb654
with:
publish-dir: doc/build/html
production-branch: main
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: "Deploy from GitHub Actions"
enable-pull-request-comment: true
enable-commit-comment: false
overwrites-pull-request-comment: true
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
timeout-minutes: 1