-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (70 loc) · 2.56 KB
/
Copy pathnightly-docs.yml
File metadata and controls
80 lines (70 loc) · 2.56 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
name: Nightly Documentation Build
on:
schedule: # UTC at 23:00 = 7pm EDT
- cron: '0 23 * * *'
workflow_dispatch:
push:
branches: ["main"]
tags: [ 'v*' ]
env:
DOCUMENTATION_CNAME: 'visor.docs.pyansys.com'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
docs_build:
name: Build docs
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Load Visor env
uses: ./.github/actions/load-visor-env
# Install Xvfb and Mesa for headless OpenGL rendering (needed for VTK and similar libraries)
- name: Install Xvfb and Mesa
run: |
sudo apt-get update
sudo apt-get install -y xvfb mesa-utils libgl1
# Start Xvfb on display :99 to provide a virtual X server for graphical tests
- name: Start Xvfb
run: |
Xvfb :99 -screen 0 1920x1080x24 &
echo "DISPLAY=:99" >> $GITHUB_ENV
# Run tests with DISPLAY=:99 (for Xvfb) and VTK_DEFAULT_RENDER_WINDOW_OFFSCREEN=1
# VTK_DEFAULT_RENDER_WINDOW_OFFSCREEN=1 ensures VTK uses offscreen rendering to avoid X errors
- name: Run Ansys documentation building action
uses: ansys/actions/doc-build@v10
env:
DISPLAY: ":99" # Use the virtual X server started by Xvfb
VTK_DEFAULT_RENDER_WINDOW_OFFSCREEN: "1" # Force VTK to use offscreen rendering
with:
checkout: false
python-version: ${{ env.MAIN_PYTHON_VERSION }}
check-links: false
sphinxopts: '-j auto'
optional-dependencies-name: ""
group-dependencies-name: "doc"
docs_upload:
needs: docs_build
runs-on: ubuntu-latest
steps:
- name: Deploy development documentation
uses: ansys/actions/doc-deploy-dev@v10
with:
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.GITHUB_TOKEN }}
bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }}
docs_upload_stable:
if: startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/release/')
needs: docs_build
runs-on: ubuntu-latest
steps:
- name: Deploy stable documentation
uses: ansys/actions/doc-deploy-stable@v10
with:
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.GITHUB_TOKEN }}
bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }}