unitdc-rs/.github/workflows/web.yml

40 lines
No EOL
839 B
YAML

name: Web
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: write
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: |
yarn global add 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