|
| 1 | +# Copyright (c) 2024, Nordic Semiconductor ASA |
| 2 | +# SPDX-License-Identifier: Apache-2.0 |
| 3 | + |
| 4 | +name: Documentation |
| 5 | + |
| 6 | +on: [push, pull_request] |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: read |
| 10 | + |
| 11 | +jobs: |
| 12 | + build: |
| 13 | + name: Build |
| 14 | + runs-on: ubuntu-22.04 |
| 15 | + strategy: |
| 16 | + matrix: |
| 17 | + doxygen-version: [1.9.6, 1.14.0] |
| 18 | + steps: |
| 19 | + - name: Checkout |
| 20 | + uses: actions/checkout@v4 |
| 21 | + with: |
| 22 | + persist-credentials: false |
| 23 | + |
| 24 | + - name: Install dependencies |
| 25 | + run: | |
| 26 | + DOXYGEN_VERSION="${{ matrix.doxygen-version }}" |
| 27 | + wget --no-verbose "https://github.com/doxygen/doxygen/releases/download/Release_${DOXYGEN_VERSION//./_}/doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz" |
| 28 | + tar xf doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz |
| 29 | + echo "${PWD}/doxygen-${DOXYGEN_VERSION}/bin" >> $GITHUB_PATH |
| 30 | + pip install -r doc/requirements.txt |
| 31 | +
|
| 32 | + - name: Build |
| 33 | + run: | |
| 34 | + cd doc |
| 35 | + doxygen |
| 36 | +
|
| 37 | + SPHINXOPTS="-W" make html |
| 38 | +
|
| 39 | + mkdir deploy |
| 40 | + mv _build_doxygen/html deploy/doxygen |
| 41 | + mv _build_sphinx/html/* deploy |
| 42 | +
|
| 43 | + - name: Setup pages |
| 44 | + if: github.event_name != 'pull_request' && matrix.doxygen-version == '1.14.0' |
| 45 | + uses: actions/configure-pages@v4 |
| 46 | + |
| 47 | + - name: Upload pages artifact |
| 48 | + if: github.event_name != 'pull_request' && matrix.doxygen-version == '1.14.0' |
| 49 | + uses: actions/upload-pages-artifact@v3 |
| 50 | + with: |
| 51 | + path: doc/deploy |
| 52 | + |
| 53 | + - name: Upload artifacts |
| 54 | + if: github.event_name == 'pull_request' |
| 55 | + uses: actions/upload-artifact@v4 |
| 56 | + with: |
| 57 | + name: docs-doxygen-${{ matrix.doxygen-version }} |
| 58 | + path: doc/deploy |
| 59 | + |
| 60 | + deploy: |
| 61 | + name: Deploy |
| 62 | + runs-on: ubuntu-22.04 |
| 63 | + needs: build |
| 64 | + if: github.event_name != 'pull_request' |
| 65 | + permissions: |
| 66 | + pages: write |
| 67 | + id-token: write |
| 68 | + steps: |
| 69 | + - name: Deploy to GitHub Pages |
| 70 | + uses: actions/deploy-pages@v4 |
0 commit comments