use actions-gh-pages #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Emscripten CI | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Emscripten | |
run: | | |
git clone https://github.com/emscripten-core/emsdk.git | |
cd emsdk | |
./emsdk install latest | |
./emsdk activate latest | |
- name: Make build directory | |
run: | | |
mkdir -p build | |
- name: Build fraction module | |
run: | | |
source emsdk/emsdk_env.sh | |
emcc src/cpp/fraction.cpp -o build/fraction.js -lembind -std=c++17 -s WASM=2 | |
- name: Build complex module | |
run: | | |
source emsdk/emsdk_env.sh | |
emcc src/cpp/complex.cpp -o build/complex.js -lembind -std=c++17 -s WASM=2 | |
- name: Build matrix module | |
run: | | |
source emsdk/emsdk_env.sh | |
emcc src/cpp/matrix.cpp -o build/matrix.js -lembind -std=c++17 -s WASM=2 | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./build | |
publish_branch: gh-pages | |