Merge pull request #21 from underworldcode/development #3
This file contains hidden or 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: API docs / pdoc3 | |
| # We should trigger this from an upload event. Note that pdoc requires us to import the | |
| # built code, so this is a building test as well as documentation deployment | |
| on: | |
| push: | |
| branches: | |
| - main # Occurs on protected branch through PR | |
| - development | |
| - Quick_Start_Docs | |
| workflow_dispatch: | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Conda environment with Micromamba | |
| uses: mamba-org/setup-micromamba@v2 | |
| with: | |
| environment-file: ./environment.yaml | |
| cache-downloads: true | |
| cache-environment: true | |
| # # gmsh is such a pig to install properly | |
| # - name: Add gmsh package | |
| # shell: bash -l {0} | |
| # run: | | |
| # pip install gmsh | |
| # the following may be needed if conda-forge is out of date | |
| # - name: Add compatible petsc4py | |
| # shell: bash -l {0} | |
| # run: | | |
| # export PETSC_DIR="/home/runner/micromamba-root/envs/uw3_docs" | |
| # pip3 install petsc4py==3.18 --upgrade | |
| - name: Build UW3 | |
| shell: bash -l {0} | |
| run: | | |
| export PETSC_DIR="/home/runner/micromamba/envs/uw3_test/lib" | |
| VERSION=`python3 setup.py --version` | |
| echo "UW - version " ${VERSION} | |
| ./compile.sh | |
| - name: Build docs with pdoc | |
| shell: bash -l {0} | |
| run: | | |
| VERSION=`python3 setup.py --version` | |
| echo "VERSION=$(echo $VERSION)" >> $GITHUB_ENV | |
| # mkdir -p docs | |
| pip install pdoc3 | |
| ./build_api_docs.sh | |
| # There is an action to build the jupyter book to a different directory | |
| # and then they can be uploaded side by side | |
| - name: Deploy | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| destination_dir: ${{ github.ref_name }}_api # The dest dir is identified by branch | |
| publish_dir: uw3_api_docs # /underworld3 |