Skip to content

armgit / gecko

Public Imported from GitHub
0

A GameCube/Wii emulator and debugger written in Rust.

deploy web

Layle89cf160b9213
diff --git a/.github/workflows/deploy-wasm.yml b/.github/workflows/deploy-wasm.yml
new file mode 100644
index 0000000..c5c5250
--- /dev/null
+++ b/.github/workflows/deploy-wasm.yml
@@ -0,0 +1,57 @@
+name: Deploy WASM
+
+on:
+ push:
+ branches: [master]
+ workflow_dispatch:
+
+permissions:
+ contents: read
+ pages: write
+ id-token: write
+
+concurrency:
+ group: pages
+ cancel-in-progress: true
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+
+ - uses: dtolnay/rust-toolchain@nightly
+ with:
+ targets: wasm32-unknown-unknown
+
+ - uses: jetli/[email protected]
+
+ - uses: actions/cache@v4
+ with:
+ path: |
+ ~/.cargo/registry
+ ~/.cargo/git
+ target
+ key: wasm-${{ hashFiles('**/Cargo.lock') }}
+ restore-keys: wasm-
+
+ - name: Build WASM
+ run: wasm-pack build crates/web --target web --out-dir pkg --release
+
+ - name: Prepare site
+ run: |
+ mkdir -p _site
+ cp crates/web/index.html _site/
+ cp -r crates/web/pkg _site/pkg
+
+ - uses: actions/upload-pages-artifact@v3
+
+ deploy:
+ needs: build
+ runs-on: ubuntu-latest
+ environment:
+ name: github-pages
+ url: ${{ steps.deployment.outputs.page_url }}
+ steps:
+ - id: deployment
+ uses: actions/deploy-pages@v4