-
Notifications
You must be signed in to change notification settings - Fork 2
37 lines (34 loc) · 1.09 KB
/
cd_wasm_gh-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
name: deploy wasm to gh-pages
on:
workflow_run:
branches: [main]
workflows: [CI]
types: [completed]
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-wasm
- name: Install wasm libcore/libstd
run: rustup target install wasm32-unknown-unknown
- name: Install wasm-bindgen
run: wasm-bindgen --version || cargo install wasm-bindgen-cli
- name: Build wasm
run: cargo build --release --target wasm32-unknown-unknown --bin demo && wasm-bindgen --out-dir ./web/ --target web ./target/wasm32-unknown-unknown/release/demo.wasm
- uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./web
keep_files: true