Fix directory again #13
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: Build & Test | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build-x86: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
shared-key: "cargo" | |
- name: Build | |
run: cargo build --verbose | |
#- name: Test | |
# run: cargo test --verbose | |
build-wasm: | |
runs-on: ubuntu-latest | |
env: | |
RUSTFLAGS: "--cfg=web_sys_unstable_apis" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
shared-key: "cargo" | |
- name: Install Target | |
run: rustup target add wasm32-unknown-unknown | |
- name: Build | |
run: cargo build --verbose --target wasm32-unknown-unknown | |
#- name: Test | |
# run: cargo test --verbose --target wasm32-unknown-unknown | |
build-deploy-release: | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/main' | |
needs: build-wasm | |
env: | |
RUSTFLAGS: "--cfg=web_sys_unstable_apis" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
shared-key: "cargo" | |
- name: Install Target | |
run: rustup target add wasm32-unknown-unknown | |
- name: Install Bindgen | |
uses: jetli/[email protected] | |
- name: Build | |
run: cargo build --release --target wasm32-unknown-unknown | |
- name: Copy Assets | |
run: mkdir -p public/static/app && cp -r assets public/static/app | |
- name: Run Bindgen | |
run: wasm-bindgen --target web --out-dir public/static/app --out-name stratmat target/wasm32-unknown-unknown/release/stratmat.wasm | |
- name: Deploy to GitHub Pages | |
uses: crazy-max/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
build_dir: public | |
fqdn: stratmat.dynamis.gg | |
jekyll: false | |