Merge pull request #139 from bashtage/update-markdown #33
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: Generate Documentation | |
on: | |
release: | |
types: [published] | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: [3.8] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
persist-credentials: false | |
fetch-depth: 0 | |
- name: Event type | |
run: echo $EVENT_TYPE | |
env: | |
EVENT_TYPE: ${{ github.event_name }} | |
- name: Install pandoc | |
uses: r-lib/actions/setup-pandoc@v1 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip wheel setuptools | |
python -m pip install -r requirements.txt | |
python -m pip install -r docs/requirements.txt | |
python -m pip list | |
- name: Install sphinx-material | |
run: python -m pip install -e . --no-build-isolation -v | |
- name: Build documentation | |
run: | | |
pushd docs | |
O="-j auto" make html | |
popd | |
- name: Move and commit documentation | |
env: | |
GIT_TAG: ${{ github.event.release.tag_name }} | |
run: | | |
source tools/docbuild-commit.sh | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: gh-pages | |
if: ${{ github.event_name == 'release' || github.event_name == 'push' }} |