forked from jupyter-xeus/xeus-python
-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (78 loc) · 2.33 KB
/
Copy pathdeploy-github-page.yml
File metadata and controls
98 lines (78 loc) · 2.33 KB
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: build and deploy
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: Github-page
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Install mamba
uses: mamba-org/setup-micromamba@v2
with:
environment-file: environment-wasm-build.yml
init-shell: bash
environment-name: xeus-python-wasm-build
- name: Set ncpus
run: echo "ncpus=$(nproc --all)" >> $GITHUB_ENV
- name: Build xeus-python
shell: bash -l {0}
run: |
micromamba create \
-f environment-wasm-host.yml --platform=emscripten-wasm32 \
-c https://prefix.dev/emscripten-forge-4x \
-c https://prefix.dev/conda-forge
set -eux
URL=https://github.com/DerThorsten/xeus-python-shell/archive/refs/heads/akernel.zip
curl -L $URL -o xeus-python-shell-akernel.zip
unzip xeus-python-shell-akernel.zip
export PREFIX=$MAMBA_ROOT_PREFIX/envs/xeus-python-wasm-host
echo "PREFIX=$PREFIX" >> $GITHUB_ENV
emcmake cmake . \
-DCMAKE_PREFIX_PATH=$PREFIX \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \
-DXPYT_EMSCRIPTEN_WASM_BUILD=ON \
-DCMAKE_VERBOSE_MAKEFILE=ON
emmake make -j${{ env.ncpus }} install
- name: Jupyter Lite integration
shell: bash -l {0}
run: |
THIS_DIR=$(pwd)
jupyter lite build \
--XeusAddon.prefix=${{ env.PREFIX }} \
--contents notebooks/ \
--output-dir dist
- name: Upload artifact
uses: actions/upload-pages-artifact@v4
with:
path: ./dist
deploy:
needs: build
if: github.ref == 'refs/heads/main'
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4