-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (35 loc) · 1.14 KB
/
deploy.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
name: Deploy to GitHub Pages
on:
push:
branches: [ main ]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: wasm32-unknown-unknown
override: true
- name: Install wasm-bindgen-cli
run: cargo install wasm-bindgen-cli
- name: Build
run: |
cargo build --release --target wasm32-unknown-unknown
wasm-bindgen --out-dir ./out/ --target web ./target/wasm32-unknown-unknown/release/bevy_wireframe.wasm
- name: Prepare deployment
run: |
# Create index.html in the out directory
echo '<html><head><script type="module">
import init from "./bevy_wireframe.js";
init();
</script></head><body></body></html>' > out/index.html
# Copy any other necessary files (like assets) to the out directory
cp -r assets out/
- name: Deploy to GitHub Pages
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: out # Deploy only the out folder