Skip to content

Commit

Permalink
Build the LTN app for web in GH actions
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreegster committed Nov 26, 2023
1 parent 4daf9a8 commit 346bdee
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions .github/workflows/book.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Rust docs
name: Rust docs and WASM app
on:
push:
branches:
- master
- main
jobs:
book:
name: Build and Deploy
Expand All @@ -14,11 +14,20 @@ jobs:
- name: Install Rust
uses: hecrj/setup-rust-action@v1

- name: Install wasm-pack
uses: jetli/[email protected]

- name: Update apt
run: sudo apt-get update
- name: Install dependencies
run: sudo apt-get install libasound2-dev libxcb-shape0-dev libxcb-xfixes0-dev libpango1.0-dev libgtk-3-dev

- name: Cache build
uses: actions/cache@v3
with:
path: target
key: doesnt-matter-share-everything

- name: Generate rustdoc
run: |
cargo doc --no-deps --workspace --exclude widgetry --document-private-items
Expand All @@ -28,6 +37,16 @@ jobs:
mkdir -p book/book
mv target/doc book/book/rustdoc
- name: Built LTN app for web
run: |
cd web
sed -i 's/^APPS=.*/APPS=ltn/' Makefile
sed -i 's/new LTN("app");/new LTN("app");\n app.setAssetsBaseURL("https:\/\/play.abstreet.org\/dev\/data");/' src/web_root/ltn.html
npm i
make release
cp -Rv build/dist ../book/book/web/
rm -fv ../book/book/web/ltn/wasm_pkg/.gitignore
- name: Publish HTML
uses: peaceiris/actions-gh-pages@v3
with:
Expand Down

0 comments on commit 346bdee

Please sign in to comment.