Deploy Github Page #25
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 Github Page | |
on: | |
workflow_dispatch: | |
env: | |
CARGO_TERM_COLOR: always | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Dependencies | |
run: | | |
rustup target install wasm32-unknown-unknown | |
cargo install wasm-bindgen-cli | |
- name: Build | |
run: | | |
cargo build --profile wasm-release --target wasm32-unknown-unknown | |
wasm-bindgen --no-typescript --target web --out-dir ./dist/tetris --out-name "tetris" ./target/wasm32-unknown-unknown/wasm-release/tetris.wasm | |
- name: Copy Assets | |
run: | | |
cp -r ./assets ./dist/assets | |
- name: Deploy | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: dist | |
branch: gh-pages |