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

42 lines
867 B
YAML
Raw Normal View History

2023-07-06 04:51:54 -05:00
name: Web
on:
workflow_run:
workflows: ["Rust Check"]
types:
- completed
branches:
- main
2023-07-06 04:51:54 -05:00
2023-07-06 04:58:34 -05:00
permissions:
contents: write
2023-07-06 04:51:54 -05:00
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: |
2023-07-06 04:58:34 -05:00
yarn global add wasm-pack
2023-07-06 04:51:54 -05:00
- 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