From 4b84808c2f98f5a51f825d4afd8d136586d087c1 Mon Sep 17 00:00:00 2001 From: mosure Date: Tue, 14 May 2024 20:56:35 -0500 Subject: [PATCH] chore: deploy pages --- .github/workflows/deploy-pages.yml | 58 ++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/deploy-pages.yml diff --git a/.github/workflows/deploy-pages.yml b/.github/workflows/deploy-pages.yml new file mode 100644 index 00000000..60d0cfed --- /dev/null +++ b/.github/workflows/deploy-pages.yml @@ -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