Skip to content

Commit b44801f

Browse files
committed
publish example to gh-pages
1 parent eb62ba5 commit b44801f

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed

.github/workflows/gh-pages.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
env:
9+
NODE_VERSION: 14.0.0
10+
11+
jobs:
12+
publish-react-app:
13+
name: Publish react example
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Fetch code
17+
uses: actions/checkout@v2
18+
with:
19+
fetch-depth: 1
20+
21+
- name: Install Rust nightly with wasm32-unknown-unknown
22+
run: rustup toolchain install nightly --target wasm32-unknown-unknown
23+
24+
- name: Install Node.js dependencies
25+
run: |
26+
npm ci
27+
cd examples/react-app && npm ci
28+
29+
- uses: actions/cache@v2
30+
id: binaryen-cache
31+
with:
32+
path: binaryen-version_100
33+
key: binaryen-version_100
34+
35+
- name: Install wasm-opt (binaryen)
36+
if: steps.binaryen-cache.outputs.cache-hit != 'true'
37+
run: |
38+
wget https://github.com/WebAssembly/binaryen/releases/download/version_100/binaryen-version_100-x86_64-linux.tar.gz
39+
tar zxvf binaryen-version_100-x86_64-linux.tar.gz binaryen-version_100/bin/wasm-opt
40+
41+
- name: Build wasm
42+
run: export PATH=$PATH:./binaryen-version_100/bin/ && make build-wasm
43+
44+
- name: Build JS
45+
run: make build-js
46+
47+
- name: Build react-app
48+
run: cd examples/react-app && npm run build
49+
50+
- name: Deploy 🚀
51+
uses: JamesIves/github-pages-deploy-action@4.1.1
52+
with:
53+
branch: gh-pages
54+
folder: examples/react-app/dist

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ clean:
4444
coverage \
4545
examples/random-in-node/node_modules \
4646
examples/react-app/dist/*.js \
47+
examples/react-app/dist/*.txt \
4748
examples/react-app/dist/*.wasm \
4849
examples/react-app/node_modules \
4950
lib \

0 commit comments

Comments
 (0)