Skip to content

Commit

Permalink
chore: deploy pages
Browse files Browse the repository at this point in the history
  • Loading branch information
mosure committed May 15, 2024
1 parent efefed9 commit 4b84808
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/deploy-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@

name: deploy github pages

on:
push:
branches:
- main
workflow_dispatch:

permissions:
contents: write

env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1

jobs:
build:
runs-on: macos-latest

steps:
- name: checkout repository
uses: actions/checkout@v3

- name: setup nightly rust toolchain with caching
uses: brndnmtthws/rust-action@v1
with:
toolchain: nightly
components: rustfmt, clippy
enable-sccache: "true"

- name: install wasm-bindgen-cli
run: cargo install wasm-bindgen-cli

- name: build wasm artifacts
run: cargo build --target wasm32-unknown-unknown --release --no-default-features --features "web"

- name: generate bindings with wasm-bindgen
run: wasm-bindgen --out-dir ./www/out/ --target web ./target/wasm32-unknown-unknown/release/viewer.wasm

- name: upload artifact for github pages
uses: actions/upload-pages-artifact@v1
with:
path: ./www/out/

deploy:
needs: build
runs-on: macos-latest

steps:
- name: checkout repository
uses: actions/checkout@v3

- name: deploy to github pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: ./www/out
branch: www

0 comments on commit 4b84808

Please sign in to comment.