set up stable versions #273
Workflow file for this run
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: Build Documentation | |
on: | |
push: | |
pull_request: | |
jobs: | |
build_docs: | |
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.10"] | |
fail-fast: false | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- name: Set env vars | |
run: | | |
export REPOSITORY_NAME=${GITHUB_REPOSITORY#*/} # just the repo, as opposed to org/repo | |
echo "REPOSITORY_NAME=${REPOSITORY_NAME}" >> $GITHUB_ENV | |
- name: Checkout the code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install documentation-building requirements with apt/dpkg | |
run: | | |
set -vxeuo pipefail | |
wget --progress=dot:giga "https://github.com/jgm/pandoc/releases/download/3.1.6.1/pandoc-3.1.6.1-1-amd64.deb" -O /tmp/pandoc.deb | |
sudo dpkg -i /tmp/pandoc.deb | |
- name: Install documentation-building requirements with pip | |
run: | | |
# For reference: https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html. | |
set -vxeo pipefail | |
pip install --upgrade pip wheel | |
pip install -v .[dev] | |
pip list | |
- name: Build Docs | |
run: make -C docs/ html | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
if: ${{ github.ref == 'refs/heads/master' }} | |
with: | |
github_token: ${{ secrets.MARIA_PUBLISH_DOCS_TOKEN }} | |
publish_dir: ./docs/build/html |