Skip to content

doc: migrate to jupytext, jupyter lab, and a solid CI/CD #21

doc: migrate to jupytext, jupyter lab, and a solid CI/CD

doc: migrate to jupytext, jupyter lab, and a solid CI/CD #21

Workflow file for this run

name: CI
on:
pull_request:
push:
tags:
- "*"
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
MAIN_PYTHON_VERSION: "3.11"
PIP_EXTRA_INDEX_URL: 'https://${{ secrets.PYANSYS_PYPI_PRIVATE_PAT }}@pkgs.dev.azure.com/pyansys/_packaging/pyansys/pypi/simple/'
DOCUMENTATION_CNAME: 'examples.workbench.docs.pyansys.com'
jobs:
#code-style:
# name: "Code style"
# runs-on: ubuntu-latest
# steps:
# - uses: ansys/actions/code-style@v6
# with:
# python-version: ${{ env.MAIN_PYTHON_VERSION }}
#doc-style:
# name: "Documentation Style Check"
# runs-on: ubuntu-latest
# steps:
# - uses: ansys/actions/doc-style@v6
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
doc-build:
name: "Build documentation"
runs-on: [self-hosted, pyworkbench]
#needs: [doc-style]
steps:
- name: "Checkout project"
uses: actions/checkout@v4
with:
path: pyworkbench
- name: "Checkout examples data"
uses: actions/checkout@v4
with:
repository: ansys/examples-data
ref: "feat/pyworkbench"
path: data
- name: "Copy additional data into PyWorkbench"
shell: bash
run: |
mv data/pyworkbench pyworkbench/examples
ls -R pyworkbench/examples/
- name: "Install Python ${{ env.MAIN_PYTHON_VERSION }}"
uses: actions/setup-python@v5
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
- name: "Install requirements"
run: |
python -m pip install -r requirements/requirements_examples.txt
python -m pip install -r requirements/requirements_doc.txt
- name: "Build HTML documentation"
working-directory: pyworkbench
run: |
sphinx-build doc/source "doc/_build/html" --color -vW -b html
doc-deploy-dev:
name: "Deploy development documentation"
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: doc-build
steps:
- uses: ansys/actions/doc-deploy-dev@v6
with:
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.GITHUB_TOKEN }}
doc-deploy-stable:
name: "Deploy stable docs"
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
runs-on: ubuntu-latest
needs: doc-build
steps:
- name: Deploy the stable documentation
uses: ansys/actions/doc-deploy-stable@v6
with:
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.GITHUB_TOKEN }}