Skip to content

Commit

Permalink
Add ci for github page
Browse files Browse the repository at this point in the history
  • Loading branch information
nmeylan committed Jun 29, 2024
1 parent bf2aa95 commit 5598a53
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 1 deletion.
51 changes: 51 additions & 0 deletions .github/workflows/deploy_web_demo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Deploy web demo

on:
release:
types: ["published"]


permissions:
contents: write # for committing to gh-pages branch

concurrency:
group: "pages"
cancel-in-progress: false

env:
RUSTFLAGS: --cfg=web_sys_unstable_apis -D warnings
RUSTDOCFLAGS: -D warnings

jobs:
# Single deploy job since we're just deploying
deploy:
name: Deploy web demo

runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- uses: actions-rs/toolchain@v1
with:
profile: minimal
target: wasm32-unknown-unknown
toolchain: 1.76.0
override: true

- uses: Swatinem/rust-cache@v2
with:
prefix-key: "web-demo-"

- name: "Install wasmopt / binaryen"
run: |
sudo apt-get update && sudo apt-get install binaryen
- run: |
scripts/build_web.sh
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: web_demo
single-commit: true
2 changes: 1 addition & 1 deletion scripts/build_web.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ CRATE_NAME="json-editor"
FEATURES="all-features"

OPEN=false
OPTIMIZE=false
OPTIMIZE=true
BUILD=release
BUILD_FLAGS="--release"
WGPU=true
Expand Down

0 comments on commit 5598a53

Please sign in to comment.