| 1 | |
| 2 | name: Documentation |
| 3 | |
| 4 | on: |
| 5 | pull_request: |
| 6 | push: |
| 7 | branches: |
| 8 | - main |
| 9 | release: |
| 10 | types: |
| 11 | - published |
| 12 | |
| 13 | jobs: |
| 14 | build-docs: |
| 15 | runs-on: ubuntu-latest |
| 16 | |
| 17 | steps: |
| 18 | - name: checkout |
| 19 | uses: actions/checkout@v3 |
| 20 | with: |
| 21 | fetch-depth: 0 |
| 22 | |
| 23 | - name: Setup Micromamba |
| 24 | uses: mamba-org/setup-micromamba@v1 |
| 25 | with: |
| 26 | environment-name: TEST |
| 27 | init-shell: bash |
| 28 | create-args: >- |
| 29 | python=3 --file requirements.txt --file requirements-dev.txt --channel conda-forge |
| 30 | |
| 31 | - name: Install branca |
| 32 | shell: bash -l {0} |
| 33 | run: | |
| 34 | python -m pip install -e . --no-deps --force-reinstall |
| 35 | |
| 36 | - name: Build documentation |
| 37 | shell: bash -l {0} |
| 38 | run: > |
| 39 | set -e |
| 40 | && pushd docs |
| 41 | && make clean html linkcheck |
| 42 | && popd |
| 43 | |
| 44 | - name: Deploy |
| 45 | if: success() && github.event_name == 'release' |
| 46 | uses: peaceiris/actions-gh-pages@v3 |
| 47 | with: |
| 48 | github_token: ${{ secrets.GITHUB_TOKEN }} |
| 49 | publish_dir: docs/build/html |