| 1 | name: Build and Deploy docs |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | branches: |
| 6 | - master |
| 7 | |
| 8 | jobs: |
| 9 | build-docs: |
| 10 | runs-on: ubuntu-latest |
| 11 | |
| 12 | steps: |
| 13 | - name: checkout |
| 14 | uses: actions/checkout@v5 |
| 15 | with: |
| 16 | fetch-depth: 0 |
| 17 | |
| 18 | - name: Setup Mamba |
| 19 | uses: mamba-org/setup-micromamba@v2 |
| 20 | with: |
| 21 | environment-name: TEST |
| 22 | create-args: >- |
| 23 | python=3 |
| 24 | numpy>1.13.3 |
| 25 | sphinx |
| 26 | |
| 27 | - name: Build environment |
| 28 | shell: bash -l {0} |
| 29 | run: | |
| 30 | python -m pip install -e . --no-deps --force-reinstall |
| 31 | |
| 32 | - name: Get the version |
| 33 | shell: bash -l {0} |
| 34 | id: get_version |
| 35 | run: echo "name=VERSION::$(python setup.py --version)" >> $GITHUB_OUTPUT |
| 36 | |
| 37 | - name: Build documentation |
| 38 | shell: bash -l {0} |
| 39 | run: | |
| 40 | set -e |
| 41 | pushd docs |
| 42 | make html linkcheck O=-W |
| 43 | popd |
| 44 | |
| 45 | - name: Deploy |
| 46 | uses: peaceiris/actions-gh-pages@v4 |
| 47 | with: |
| 48 | github_token: ${{ secrets.GITHUB_TOKEN }} |
| 49 | publish_dir: docs/_build/html |