Update main.yml #29
This file contains 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: Docs | |
on: | |
push: | |
branches: | |
- master | |
- npe2 | |
tags: | |
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10 | |
pull_request: | |
branches: | |
- main | |
- npe2 | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
docs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v2.2.1 | |
with: | |
python-version: 3.9 | |
- name: Install dependencies | |
run: sudo apt-get install -y libxkbcommon-x11-0 | |
- name: Set QT_QPA_PLATFORM | |
run: echo "QT_QPA_PLATFORM=offscreen" >> $GITHUB_ENV | |
- name: Install dependencies | |
run: | | |
pip install "napari[all]" | |
pip install Sphinx sphinx-rtd-theme sphinx-tabs myst-parser | |
- name: Sphinx build | |
run: | | |
pip install . | |
cd ./docs | |
sphinx-apidoc -T -f -e -o . ../src | |
make html | |
cd .. | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} | |
with: | |
publish_branch: gh-pages | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: docs/build/html | |
force_orphan: true |