Skip to content

Merge pull request #132 from bitcoinjs/dependabot/npm_and_yarn/exampl… #44

Merge pull request #132 from bitcoinjs/dependabot/npm_and_yarn/exampl…

Merge pull request #132 from bitcoinjs/dependabot/npm_and_yarn/exampl… #44

Workflow file for this run

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/github-pages-deploy-action@4.1.1
with:
branch: gh-pages
folder: examples/react-app/dist