Merge pull request #125 from bitcoinjs/dependabot/npm_and_yarn/word-w… #40
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: 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_114 | |
key: binaryen-version_114 | |
- name: Install wasm-opt (binaryen) | |
if: steps.binaryen-cache.outputs.cache-hit != 'true' | |
run: | | |
wget https://github.com/WebAssembly/binaryen/releases/download/version_114/binaryen-version_114-x86_64-linux.tar.gz | |
tar zxvf binaryen-version_114-x86_64-linux.tar.gz binaryen-version_114/bin/wasm-opt binaryen-version_114/bin/wasm2js | |
- name: Build wasm | |
run: export PATH=$PATH:./binaryen-version_114/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 |