Adds dark theme and theme switching functionality (REPL + website) #53
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 and Deploy | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- '*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Install the dependencies | |
run: | | |
python -m pip install -r requirements.txt | |
- name: Build the JupyterLite site | |
run: | | |
jupyter lite build | |
- name: Build dark theme support bridge | |
working-directory: repl-theme-bridge | |
run: jlpm run build | |
# Check for Pyodide kernel and theme bridge extension | |
# For some reason "jupyter labextension list" writes to | |
# both stdout and stderr, causing grep to fail. Maybe | |
# bug upstream? | |
- name: Sanity check extensions | |
run: | | |
jupyter labextension list 2>&1 | grep -E 'sympy-live-repl-theme-bridge' | |
jupyter labextension list 2>&1 | grep -E 'pyodide-kernel-extension' | |
- name: Add custom index.html (live.sympy.org landing page) and static/ files | |
run: python generateindex.py | |
- name: Add CNAME file containing live.sympy.org | |
run: | | |
echo "live.sympy.org" > ./_output/CNAME | |
- name: Upload (dist) | |
uses: actions/upload-artifact@v4 | |
with: | |
name: jupyterlite-demo-dist-${{ github.run_number }} | |
path: ./_output | |
if-no-files-found: error | |
deploy: | |
if: github.ref == 'refs/heads/main' | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2.3.1 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: jupyterlite-demo-dist-${{ github.run_number }} | |
path: ./dist | |
merge-multiple: true | |
- name: Deploy | |
uses: JamesIves/github-pages-deploy-action@4.1.3 | |
with: | |
branch: gh-pages | |
folder: dist |