Compare commits

...

2 Commits

Author SHA1 Message Date
2b667bb6a2 ci: add deploy workflow + build script 2025-06-17 11:47:25 -05:00
9a88e71202 chore: .idea folder in .gitignore 2025-06-17 11:47:18 -05:00
3 changed files with 39 additions and 0 deletions

28
.github/workflows/deploy.yaml vendored Normal file
View File

@@ -0,0 +1,28 @@
name: Github Pages
on: [push]
permissions:
contents: write
jobs:
build-github-pages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2 # repo checkout
- uses: mymindstorm/setup-emsdk@v11 # setup emscripten toolchain
# with:
# version: 3.1.35
- uses: actions-rs/toolchain@v1 # get rust toolchain for wasm
with:
toolchain: stable
target: wasm32-unknown-emscripten
override: true
- name: Rust Cache # cache the rust build artefacts
uses: Swatinem/rust-cache@v1
- name: Build # build
run: ./build.sh
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: dist

1
.gitignore vendored
View File

@@ -1 +1,2 @@
/target
.idea

10
build.sh Normal file
View File

@@ -0,0 +1,10 @@
#!/bin/sh
set -eux
cargo build --target=wasm32-unknown-emscripten --release
mkdir -p dist
cp target/wasm32-unknown-emscripten/release/rust_sdl2_wasm.wasm dist
cp target/wasm32-unknown-emscripten/release/rust-sdl2-wasm.js dist
cp index.html dist