-
Notifications
You must be signed in to change notification settings - Fork 3
42 lines (34 loc) · 1.05 KB
/
wasm.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
name: Build and Deploy C++ WebAssembly
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Emscripten
run: |
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh
- name: Create Build Directory
run: mkdir build
- name: CMake Configure and Build
run: |
cd build
emcmake cmake ..
emmake make
# If you want to test using emrun before deploying (this won't display anything but will confirm if it runs without errors)
- name: Test with emrun
run: |
cd build/web
emrun --no_browser --port 8080 index.html & # Start in background
sleep 10 # Give some time for the server to start and serve
kill %1 # Kill background job
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@4.1.5
with:
branch: gh-pages
folder: build/web