Merge pull request #236 from ocefpaf/bump_pre-commits #221
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: Documentation | |
| # no permissions by default | |
| permissions: {} | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| release: | |
| types: | |
| - published | |
| jobs: | |
| build-docs: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Setup Micromamba Python | |
| uses: mamba-org/setup-micromamba@add3a49764cedee8ee24e82dfde87f5bc2914462 # v2.0.7 | |
| with: | |
| environment-name: TEST | |
| init-shell: bash | |
| create-args: >- | |
| python=3 --file requirements.txt --file requirements-dev.txt --channel conda-forge | |
| - name: Install ctd | |
| shell: bash -l {0} | |
| run: | | |
| python -m pip install -e . --no-deps --force-reinstall | |
| - name: Build documentation | |
| shell: bash -l {0} | |
| run: > | |
| set -e | |
| && jupyter nbconvert --to notebook --execute notebooks/quick_intro.ipynb --output=quick_intro-output.ipynb | |
| && mv notebooks/*output.ipynb docs/source/ | |
| && pushd docs | |
| && make clean html linkcheck | |
| && popd | |
| - name: Deploy | |
| if: success() && github.event_name == 'release' | |
| uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: docs/build/html |