Organize colormaps documentation into meaningful categories #528
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 docs | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - '*' | |
| pull_request: | |
| branches: | |
| - main | |
| workflow_dispatch: # Manual trigger for publishing docs | |
| jobs: | |
| build-docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 # Required for setuptools-scm to get version from tags | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: 3.12 | |
| - uses: actions/cache@v5 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py', '**/pyproject.toml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip- | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y inkscape --no-install-recommends | |
| pip install --upgrade pip | |
| pip install wheel setuptools numpy cython | |
| # force using latest nibabel | |
| pip install -U nibabel | |
| pip install -q ipython Sphinx sphinx-gallery numpydoc # TODO: move to pyproject.toml | |
| pip install -e . --no-build-isolation --group dev | |
| python -c 'import cortex; print(cortex.__full_version__)' | |
| - name: Cache Playwright browsers | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.cache/ms-playwright | |
| key: ${{ runner.os }}-playwright-${{ hashFiles('**/pyproject.toml') }} | |
| - name: Install Playwright Chromium | |
| run: playwright install --with-deps --only-shell chromium | |
| - name: Build documents | |
| timeout-minutes: 20 | |
| run: | | |
| cd docs && make html && cd .. | |
| touch docs/_build/html/.nojekyll | |
| - name: Publish to gh-pages if tagged | |
| if: startsWith(github.ref, 'refs/tags') || github.event_name == 'workflow_dispatch' | |
| uses: JamesIves/github-pages-deploy-action@v4.8.0 | |
| with: | |
| branch: gh-pages | |
| folder: docs/_build/html |