Build and Deploy #75
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: | |
- "*" | |
# To ensure we always fetch the latest SymPy wheel | |
# and build the site daily | |
schedule: | |
- cron: "0 3 * * *" | |
# Allow manual trigger to rebuild if something failed | |
workflow_dispatch: | |
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 JupyterLite dependencies | |
run: | | |
python -m pip install -r requirements.txt | |
- name: Download latest stable SymPy wheel | |
run: | | |
mkdir -p custom_wheels | |
python -m pip download sympy \ | |
--only-binary=:all: \ | |
--no-deps \ | |
--dest custom_wheels | |
- name: Reduce the size of the wheel | |
run: pipx run unvendor_tests_from_wheel.py custom_wheels/ | |
- name: Build the JupyterLite site | |
run: jupyter lite build | |
- name: Add custom index.html (live.sympy.org landing page) and static/ files | |
run: pipx run generate_index.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 |