new deploy file #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |