Skip to content

Commit 728a855

Browse files
committed
Add deploy
1 parent 258438d commit 728a855

8 files changed

Lines changed: 294 additions & 230 deletions

File tree

‎.github/workflows/deploy.yml‎

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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+
- uses: actions/checkout@v4
23+
24+
- uses: pnpm/action-setup@v4
25+
with:
26+
version: latest
27+
cache: true
28+
29+
- uses: actions/setup-node@v4
30+
with:
31+
node-version: '20'
32+
cache: 'pnpm'
33+
34+
- uses: actions-rust-lang/setup-rust-toolchain@v1
35+
with:
36+
target: wasm32-unknown-unknown
37+
38+
- name: Install wasm-pack
39+
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
40+
41+
- name: Build
42+
run: make all
43+
44+
- uses: actions/configure-pages@v4
45+
46+
- uses: actions/upload-pages-artifact@v3
47+
with:
48+
path: './ts/dist'
49+
50+
deploy:
51+
environment:
52+
name: github-pages
53+
url: ${{ steps.deployment.outputs.page_url }}
54+
runs-on: ubuntu-latest
55+
needs: build
56+
steps:
57+
- name: Deploy to GitHub Pages
58+
id: deployment
59+
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: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,13 @@ TS_LIB = $(TS_ROOT)lib/
77
TS_DIST = $(TS_ROOT)dist/
88
TS_MAIN = $(TS_DIST)main.js
99
RS_SRC = rs/
10-
RS_LIB = $(TS_ROOT)lib/libentropy.wasm
10+
RS_LIB = $(TS_ROOT)lib/libentropy_bg.wasm
1111

1212
all: $(RS_LIB) $(TS_MAIN)
1313

1414
clean:
1515
(cd $(RS_SRC); cargo clean)
16-
-rm $(RS_LIB) $(TS_MAIN)
17-
-rm -rf $(TS_DIST)
16+
-rm -rf node_modules $(TS_ROOT)node_modules $(TS_LIB) $(TS_DIST)
1817

1918
update:
2019
cargo update
@@ -28,7 +27,6 @@ $(RS_LIB): $(RS_SRC)src/*.rs
2827
(cd $(RS_SRC); wasm-pack build --target web --out-dir ../$(TS_LIB))
2928

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

3432
server:

0 commit comments

Comments
 (0)