doc: migrate to jupytext, jupyter lab, and a solid CI/CD #16
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
- 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: doc | |
run: | | |
.\make.bat 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 }} |