Merge pull request #317 from python-windrose/dependabot/github_action… #268
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: Build and Deploy docs | |
| # no permissions by default | |
| permissions: {} | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| release: | |
| types: | |
| - published | |
| jobs: | |
| build-docs: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Setup Micromamba | |
| uses: mamba-org/setup-micromamba@d7c9bd84e824b79d2af72a2d4196c7f4300d3476 # v3.0.0 | |
| with: | |
| environment-name: TEST | |
| init-shell: bash | |
| create-args: >- | |
| python=3 pip | |
| --file requirements.txt | |
| --file requirements-dev.txt | |
| --channel conda-forge | |
| - name: Install windrose | |
| run: | | |
| python -m pip install -e . --no-deps --force-reinstall | |
| - name: Build documentation | |
| run: | | |
| set -e | |
| jupyter nbconvert --to notebook --execute notebooks/usage.ipynb --output=usage-output.ipynb | |
| mv notebooks/*output.ipynb docs/ | |
| 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 |