Skip to content

Nightly Documentation Build #1199

Nightly Documentation Build

Nightly Documentation Build #1199

Workflow file for this run

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 ansys.aedt.core import __version__; print(__version__)')" >> $GITHUB_OUTPUT
echo "PyAEDT version is: $(python -c "from ansys.aedt.core 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 }}