2021-06-25 18:02:45 +01:00
|
|
|
name: test and deploy
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ master ]
|
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Install wasm-pack
|
2021-07-02 13:53:51 +01:00
|
|
|
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
|
2021-06-25 18:02:45 +01:00
|
|
|
|
|
|
|
- name: Test WASM in-browser
|
|
|
|
run: wasm-pack test --firefox --chrome --headless
|
|
|
|
|
2021-06-30 00:43:39 +01:00
|
|
|
- name: Build Rust for WASM
|
2021-07-01 17:32:12 +01:00
|
|
|
run: wasm-pack build --release
|
2021-06-30 00:43:39 +01:00
|
|
|
|
2021-06-26 21:13:06 +01:00
|
|
|
- name: Install Node
|
|
|
|
uses: actions/setup-node@v2
|
|
|
|
with:
|
2022-05-05 23:02:04 +01:00
|
|
|
node-version: 18
|
2021-06-26 21:13:06 +01:00
|
|
|
|
|
|
|
- name: Install Node Modules
|
|
|
|
run: npm ci
|
|
|
|
working-directory: ./www
|
|
|
|
|
|
|
|
- name: Build Js
|
|
|
|
run: npm run build --if-present
|
|
|
|
working-directory: ./www
|
|
|
|
|
|
|
|
- name: Build Docs
|
|
|
|
run: cargo doc --no-deps --document-private-items
|
|
|
|
|
|
|
|
- name: Move Docs to Staging Directory
|
|
|
|
run: mv target/doc www/dist/
|
|
|
|
|
2022-05-05 23:02:04 +01:00
|
|
|
- name: Move CNAME file to Staging Directory
|
|
|
|
run: mv docs/CNAME www/dist
|
|
|
|
|
2021-06-26 21:13:06 +01:00
|
|
|
- name: Deploy To Pages
|
|
|
|
uses: peaceiris/actions-gh-pages@v3
|
|
|
|
with:
|
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
publish_dir: ./www/dist
|