-
Notifications
You must be signed in to change notification settings - Fork 55
54 lines (43 loc) · 1.36 KB
/
gh-pages.yaml
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
47
48
49
50
51
52
53
54
name: ReactExample
on:
push:
branches:
- master
env:
NODE_VERSION: 18.16.1
jobs:
publish-react-app:
name: Publish react example
runs-on: ubuntu-latest
steps:
- name: Fetch code
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Install Rust toolchain with wasm32-unknown-unknown
run: rustup toolchain install $(cat ./rust-toolchain) --target wasm32-unknown-unknown
- name: Install Node.js dependencies
run: |
npm ci
cd examples/react-app && npm ci
- uses: actions/cache@v2
id: binaryen-cache
with:
path: binaryen-version_100
key: binaryen-version_100
- name: Install wasm-opt (binaryen)
if: steps.binaryen-cache.outputs.cache-hit != 'true'
run: |
wget https://github.com/WebAssembly/binaryen/releases/download/version_100/binaryen-version_100-x86_64-linux.tar.gz
tar zxvf binaryen-version_100-x86_64-linux.tar.gz binaryen-version_100/bin/wasm-opt
- name: Build wasm
run: export PATH=$PATH:./binaryen-version_100/bin/ && make build-wasm
- name: Build JS
run: make build-js
- name: Build react-app
run: cd examples/react-app && npm run build
- name: Deploy 🚀
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: examples/react-app/dist