add web deployment action

This commit is contained in:
ゆめ 2023-07-06 04:51:54 -05:00
parent d3d2327112
commit df0b953df4

37
.github/workflows/web.yml vendored Normal file
View file

@ -0,0 +1,37 @@
name: Web
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Setup Node.js environment
uses: actions/setup-node@v3.7.0
- uses: actions/checkout@v3
- name: Run tests
run: |
cargo test --verbose
- name: Install wasm-pack
run: |
cargo install wasm-pack
- name: Build wasm
run: |
cd crates/unitdc-web && wasm-pack build --target web
- name: Build UI
run: |
cd crates/unitdc-web/ui && yarn && yarn build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./crates/unitdc-web/ui/dist