ENH: Add discussion of when to use assertions vs exceptions #190
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-and-deploy | |
# Only run this when the master branch changes | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
# This job installs dependencies, build the book, and pushes it to `gh-pages` | |
jobs: | |
deploy-book: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/cache@v3 | |
with: | |
path: /var/lib/apt | |
key: apt-cache-v2 | |
restore-keys: | | |
apt-cache-v2 | |
- name: Install system dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y --no-install-recommends \ | |
curl \ | |
bzip2 \ | |
ca-certificates \ | |
dvipng | |
- uses: actions/checkout@v3 | |
# Install dependencies | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install Pip dependencies | |
run: | | |
pip install "pip==23.0.1" | |
pip install -r build_requirements.txt | |
# Build the page | |
- name: Build the book | |
run: | | |
make html | |
- uses: actions/upload-artifact@v3 | |
if: failure() | |
with: | |
name: error_logs | |
path: ./_build/html/reports | |
# Push the book's HTML to github-pages | |
- name: GitHub Pages action | |
if: ${{ github.ref == 'refs/heads/main' }} | |
uses: peaceiris/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./_build/html |