-
Notifications
You must be signed in to change notification settings - Fork 9
51 lines (38 loc) · 1.22 KB
/
deploy-pages.yml
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
name: deploy github pages
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: write
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
deploy:
runs-on: macos-latest
steps:
- name: checkout repository
uses: actions/checkout@v3
- name: setup nightly rust toolchain with caching
uses: brndnmtthws/rust-action@v1
with:
toolchain: nightly
components: rustfmt, clippy
enable-sccache: "true"
- name: install wasm32-unknown-unknown
run: rustup target add wasm32-unknown-unknown
- name: install wasm-bindgen-cli
run: cargo install wasm-bindgen-cli
- name: build wasm artifacts
run: cargo build --target wasm32-unknown-unknown --release --no-default-features --features "web"
- name: generate bindings with wasm-bindgen
run: wasm-bindgen --out-dir ./www/out/ --target web ./target/wasm32-unknown-unknown/release/viewer.wasm
- name: copy assets
run: mkdir -p ./www/assets && cp -r ./assets/* ./www/assets/
- name: deploy to github pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: ./www
branch: www