ci: fix woke check, exclude in-tree clone directories, and modernize … #2
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 SOF Documentation | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - main | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| name: Build Documentation | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Documentation Source | |
| uses: actions/checkout@v4 | |
| - name: Set up Python 3.13 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.13' | |
| - name: Install Base System Dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y doxygen graphviz ninja-build cmake default-jre | |
| - name: Install Python Documentation Dependencies | |
| run: | | |
| pip install -r scripts/requirements.txt -c scripts/constraints.txt | |
| pip install pyyaml | |
| - name: Optional API Docs (Clone SOF & Doxygen) | |
| continue-on-error: true | |
| run: | | |
| git clone --depth 1 https://github.com/thesofproject/sof.git _deps/sof | |
| if ! grep -q "zephyr/include" _deps/sof/doc/sof.doxygen.in; then | |
| echo "INPUT += @top_srcdir@/zephyr/include" >> _deps/sof/doc/sof.doxygen.in | |
| fi | |
| cmake -GNinja -S _deps/sof/doc -B _build_doxy | |
| ninja -C _build_doxy doc | |
| - name: Generate Dynamic Platform & Algorithm Matrices | |
| run: | | |
| python3 scripts/generate_matrices.py | |
| - name: Build Sphinx Documentation | |
| run: | | |
| if [ -d "_build_doxy" ]; then | |
| make html VERBOSE=1 SOF_DOC_BUILD=_build_doxy | |
| else | |
| make html VERBOSE=1 | |
| fi | |
| - name: Prepare Publish Directory Structure | |
| run: | | |
| mkdir -p _site/latest | |
| cp -r _build/html/* _site/latest/ | |
| # Landing redirect to /latest/ | |
| echo '<meta http-equiv="refresh" content="0; url=latest/">' > _site/index.html | |
| echo '<a href="latest/">Redirecting to latest SOF documentation...</a>' >> _site/index.html | |
| touch _site/.nojekyll | |
| - name: Upload Pages Artifact | |
| if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: _site | |
| deploy: | |
| name: Deploy to GitHub Pages | |
| needs: build | |
| if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |