Skip to content

Bump the trame group with 2 updates (#610) #2374

Bump the trame group with 2 updates (#610)

Bump the trame group with 2 updates (#610) #2374

Workflow file for this run

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@v6
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-python@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@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@v6
with:
name: doc-build-${{ matrix.builder }}
path: doc-build-${{ matrix.builder }}.tar.gz
- uses: actions/upload-artifact@v6
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@v6
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@v6
with:
persist-credentials: false
- uses: actions/download-artifact@v7
with:
name: doc-build-html
path: .
- uses: actions/download-artifact@v7
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@v6
with:
persist-credentials: false
- uses: actions/download-artifact@v7
with:
name: doc-build-html
path: .
- uses: actions/download-artifact@v7
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