Skip to content

Commit 5ea3105

Browse files
committed
Add web deploy
1 parent 181a62c commit 5ea3105

1 file changed

Lines changed: 57 additions & 0 deletions

File tree

‎.github/workflows/web-deploy.yml‎

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Build and Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
permissions:
7+
contents: read
8+
pages: write
9+
id-token: write
10+
11+
concurrency:
12+
group: "pages"
13+
cancel-in-progress: true
14+
15+
jobs:
16+
build-and-deploy:
17+
environment:
18+
name: github-pages
19+
url: ${{ steps.deployment.outputs.page_url }}
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
26+
- name: Install Ninja Build
27+
run: sudo apt-get install ninja-build
28+
29+
- name: Setup Emscripten
30+
uses: mymindstorm/setup-emsdk@v14
31+
with:
32+
version: latest
33+
34+
- name: Configure CMake
35+
run: emcmake cmake -G Ninja -B build-web
36+
37+
- name: Build the project
38+
run: cmake --build build-web
39+
40+
- name: Prepare Deployment Folder
41+
run: |
42+
mkdir -p dist
43+
cp build-web/complex-plotter.js dist/
44+
cp build-web/complex-plotter.wasm dist/
45+
cp build-web/index.html dist/
46+
47+
- name: Setup GitHub Pages
48+
uses: actions/configure-pages@v4
49+
50+
- name: Upload artifact
51+
uses: actions/upload-pages-artifact@v3
52+
with:
53+
path: './dist'
54+
55+
- name: Deploy to GitHub Pages
56+
id: deployment
57+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)