-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (40 loc) · 1.54 KB
/
emscripten.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
name: Emscripten Build and Deploy to GitHub Pages
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Clone Emscripten
run: |
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install latest
./emsdk activate latest
echo "EMSDK_PATH=$(pwd)/emsdk" >> $GITHUB_ENV
echo "EMSDK_NODE=$(pwd)/node/14.15.5_64bit/bin" >> $GITHUB_ENV
echo "EMSCRIPTEN=$(pwd)/upstream/emscripten" >> $GITHUB_ENV
echo "PATH=$(pwd):$(pwd)/upstream/emscripten:$(pwd)/node/14.15.5_64bit/bin:$PATH" >> $GITHUB_ENV
echo "PATH=$(pwd):/home/runner/work/laszlo/laszlo/emsdk:/home/runner/work/laszlo/laszlo/emsdk/upstream/emscripten:$PATH" >> $GITHUB_ENV
cd ..
- name: Create Build Directory
run: |
mkdir build
- name: Configure CMake Project and Build
run: |
cd build
emcmake cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build .
mv src/laszlo.html src/index.html
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
publish_dir: ./build/src # Specify the directory you want to publish
publish_branch: gh-pages # The target branch
keep_files: false # Set to false to remove existing files in gh-pages branch