generated from jupyterlite/demo
-
-
Notifications
You must be signed in to change notification settings - Fork 7
77 lines (66 loc) · 2.14 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- 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@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: jupyterlite-demo-dist-${{ github.run_number }}
path: ./_output
if-no-files-found: error
deploy:
if: github.ref == 'refs/heads/main'
needs: build
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: jupyterlite-demo-dist-${{ github.run_number }}
path: ./dist
merge-multiple: true
- name: Deploy
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: dist