add CI build & deploy #1
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
# see https://github.com/actions/starter-workflows/blob/main/pages/jekyll.yml | |
name: Build & Publish site | |
on: | |
push: | |
workflow_dispatch: | |
permissions: | |
# allow GITHUB_TOKEN to deploy to GitHub Pages | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: {group: "pages", cancel-in-progress: true} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ruby/setup-python@v1 | |
with: {python-version: '3.x'} | |
- id: pages | |
uses: actions/configure-pages@v3 | |
- name: jupyter-book build | |
run: | | |
sed -ri 's#^(\s*baseurl:).*#\1 ${{ steps.pages.outputs.base_url }}#' _config.yml | |
# https://jupyterbook.org/en/stable/reference/cli.html | |
jupyter-book build --warningiserror --nitpick . | |
- uses: actions/upload-pages-artifact@v1 | |
with: {path: _build/html} | |
deploy: | |
if: github.ref == 'refs/heads/main' | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- id: deployment | |
uses: actions/deploy-pages@v2 |