Skip to content

Commit c63f033

Browse files
committed
Add deploy
1 parent 258438d commit c63f033

7 files changed

Lines changed: 291 additions & 224 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: "pages"
16+
cancel-in-progress: false
17+
18+
jobs:
19+
build:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Setup Node.js
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: '18'
29+
cache: 'pnpm'
30+
cache-dependency-path: 'ts/pnpm-lock.yaml'
31+
32+
- name: Setup Rust
33+
uses: actions-rust-lang/setup-rust-toolchain@v1
34+
with:
35+
target: wasm32-unknown-unknown
36+
37+
- name: Install wasm-pack
38+
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
39+
40+
- name: Install dependencies
41+
run: |
42+
cd ts
43+
pnpm install
44+
45+
- name: Build
46+
run: make all
47+
48+
- name: Setup Pages
49+
uses: actions/configure-pages@v4
50+
51+
- name: Upload artifact
52+
uses: actions/upload-pages-artifact@v3
53+
with:
54+
path: './ts/dist'
55+
56+
deploy:
57+
environment:
58+
name: github-pages
59+
url: ${{ steps.deployment.outputs.page_url }}
60+
runs-on: ubuntu-latest
61+
needs: build
62+
steps:
63+
- name: Deploy to GitHub Pages
64+
id: deployment
65+
uses: actions/deploy-pages@v4

Cargo.lock

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ $(RS_LIB): $(RS_SRC)src/*.rs
2828
(cd $(RS_SRC); wasm-pack build --target web --out-dir ../$(TS_LIB))
2929

3030
$(TS_MAIN): $(RS_LIB) $(TS_SRC)*.ts
31-
echo "export const HASH = \"`git rev-parse --short HEAD`\";" > $(TS_ROOT)src/hash.ts
3231
(cd $(TS_ROOT); pnpm i; pnpm run build)
3332

3433
server:

0 commit comments

Comments
 (0)