Skip to content

wasm support to run geomedea in the browser #12

wasm support to run geomedea in the browser

wasm support to run geomedea in the browser #12

Workflow file for this run

name: Deploy to GitHub Pages
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
deploy-pages:
runs-on: ubuntu-latest
permissions:
contents: write
pages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Cache cargo registry
uses: actions/cache@v3
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
- name: Cache cargo index
uses: actions/cache@v3
with:
path: ~/.cargo/index
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-index-
- name: Cache cargo build
uses: actions/cache@v3
with:
path: target
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('geomedea/geomedea-wasm/src/**/*.rs') }}
restore-keys: |
${{ runner.os }}-cargo-build-${{ runner.os }}-
- name: Install wasm-pack
run: |
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Build WebAssembly project
run: wasm-pack build --target web
working-directory: geomedea-wasm
- name: Copy web assets
run: |
rm geomedea-wasm/web_root/js/geomedea \
&& cp -r geomedea-wasm/pkg geomedea-wasm/web_root/js/geomedea \
&& find geomedea-wasm/web_root && ls -la geomedea-wasm/web_root
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: geomedea-wasm/web_root