migrate to sphinx-immaterial #31
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
# Syntax reference for this file: | |
# https://help.github.com/en/articles/workflow-syntax-for-github-actions | |
name: sphinx | |
on: [push] | |
# https://gist.github.com/c-bata/ed5e7b7f8015502ee5092a3e77937c99 | |
jobs: | |
build-and-delpoy: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
# https://github.com/marketplace/actions/checkout | |
- uses: actions/checkout@v3 | |
# https://github.com/marketplace/actions/setup-python | |
# ^-- This gives info on matrix testing. | |
- name: Install Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.11" | |
# I don't know where the "run" thing is documented. | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
cp logo/ElectricpyLogo.svg docsource/static/ElectricpyLogo.svg | |
pip install -r docsource/requirements.txt | |
- name: Build Sphinx docs | |
if: success() | |
run: | | |
pip install . | |
python3 -c "import electricpy; print('electricpy.__file__')" | |
sphinx-build -M html docsource docs | |
- name: Generate Coverage Badge | |
if: success() | |
run: | | |
pip install -r test/requirements.txt | |
coverage run --source=./electricpy -m pytest | |
coverage-badge -o docs/html/coverage.svg | |
# https://github.com/marketplace/actions/github-pages | |
#- if: success() | |
# uses: crazy-max/ghaction-github-pages@master | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# with: | |
# target_branch: gh-pages | |
# build_dir: _build/html/ | |
# https://github.com/peaceiris/actions-gh-pages | |
- name: Deploy | |
if: success() | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
publish_branch: gh-pages | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: docs/html/ | |
# This action probably does everything for you: | |
# https://github.com/marketplace/actions/sphinx-build |