Skip to content

Commit

Permalink
feat(github-action): add github action to compile wasm build and depl…
Browse files Browse the repository at this point in the history
…oy to github pages
  • Loading branch information
kpbaks committed Apr 6, 2024
1 parent d7d34c4 commit eef28c6
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/deploy-page.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: deploy-github-page

on: [push, workflow_dispatch]
# workflow_dispatch:

permissions:
contents: write

jobs:
build-web:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Install Dependencies
run: sudo apt-get update; sudo apt-get install pkg-config libx11-dev libasound2-dev libudev-dev
- name: Install trunk
uses: jetli/[email protected]
with:
version: 'latest'
- name: Add wasm target
run: |
rustup target add wasm32-unknown-unknown
- name: Build Release
working-directory: ./crates/gbpplanner-rs
run: |
trunk build --release
- name: optimize Wasm
uses: NiklasEi/wasm-opt-action@v2
with:
file: ./crates/gbpplanner-rs/dist/*.wasm
- name: Deploy to GitHub Pages
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: ./crates/gbpplanner-rs/dist

0 comments on commit eef28c6

Please sign in to comment.