Repository navigation
50 lines (46 loc) · 1.68 KB
/
Copy pathpages.yml
File metadata and controls
50 lines (46 loc) · 1.68 KB
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
name: Deploy browser demo (GitHub Pages)
# Builds the WebAssembly module and publishes examples/browser_demo/ at https://voidstackloop.github.io/oxideon/
# One-time setup: repository Settings -> Pages -> Source: "GitHub Actions".
on:
push:
branches: [main]
paths:
- "examples/browser_demo/**"
- "crates/oxideon-core/src/wasm.rs"
- ".github/workflows/pages.yml"
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: Build the WebAssembly module
run: cargo build --release --lib --target wasm32-unknown-unknown --no-default-features --features wasm
- name: Generate the JavaScript bindings (same wasm-bindgen version as Cargo.lock)
run: |
version=$(grep -A1 'name = "wasm-bindgen"$' Cargo.lock | grep -m1 version | cut -d'"' -f2)
cargo install wasm-bindgen-cli --version "$version" --locked
mkdir -p site/assets
cp examples/browser_demo/index.html site/
cp docs/assets/oxideon-logo.svg site/assets/oxideon-logo.svg
wasm-bindgen target/wasm32-unknown-unknown/release/oxideon.wasm --target web --out-dir site/pkg
ls -la site site/pkg
- uses: actions/configure-pages@v5
- uses: actions/upload-pages-artifact@v3
with:
path: site
- id: deployment
uses: actions/deploy-pages@v4