Skip to content

Commit 2ba24a3

Browse files
committed
add gh action to deploy playground
1 parent 4e2c2ff commit 2ba24a3

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
lines changed

.github/workflows/playground.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Deploy Playground
2+
3+
on:
4+
workflow_dispatch:
5+
6+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
7+
permissions:
8+
contents: read
9+
pages: write
10+
id-token: write
11+
12+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
13+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
14+
concurrency:
15+
group: "pages"
16+
cancel-in-progress: false
17+
18+
jobs:
19+
build:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
- run: rustup show
24+
- uses: jdx/mise-action@v2
25+
- run: pnpm install
26+
- run: mise build:pg
27+
- name: Upload artifact
28+
uses: actions/upload-pages-artifact@v3
29+
with:
30+
path: packages/playground/dist
31+
32+
deploy:
33+
environment:
34+
name: github-pages
35+
url: ${{ steps.deployment.outputs.page_url }}
36+
runs-on: ubuntu-latest
37+
needs: build
38+
steps:
39+
- name: Deploy to GitHub Pages
40+
id: deployment
41+
uses: actions/deploy-pages@v4

mise.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ run = [
1818
"wasm-pack build --release --no-pack --target nodejs --out-dir ../wasm_node",
1919
]
2020

21+
[tasks.'build:pg']
22+
depends = "build:wasm"
23+
dir ="./packages/playground"
24+
run = "pnpm run build"
25+
2126
[tasks.'test:wasm']
2227
dir ="{{ config_root }}/packages/wasm/test"
2328
run = "node --test test.mjs"

packages/playground/vite.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import wasm from 'vite-plugin-wasm'
44

55
// https://vite.dev/config/
66
export default defineConfig({
7+
base: './',
78
build: {
89
target: 'es2022'
910
},

0 commit comments

Comments
 (0)