Skip to content

Commit 0adbd06

Browse files
committed
Add deploy
1 parent 258438d commit 0adbd06

9 files changed

Lines changed: 294 additions & 231 deletions

File tree

‎.github/workflows/deploy.yml‎

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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+
28+
- uses: actions/setup-node@v4
29+
with:
30+
node-version: '20'
31+
cache: 'pnpm'
32+
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: Build
41+
run: make all
42+
43+
- uses: actions/configure-pages@v4
44+
45+
- uses: actions/upload-pages-artifact@v3
46+
with:
47+
path: './ts/dist'
48+
49+
deploy:
50+
environment:
51+
name: github-pages
52+
url: ${{ steps.deployment.outputs.page_url }}
53+
runs-on: ubuntu-latest
54+
needs: build
55+
steps:
56+
- name: Deploy to GitHub Pages
57+
id: deployment
58+
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:

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Playground for Compression
22

3-
- [Launch now](https://nerry.jp/prefix-code/)
3+
- [Launch now](https://neri.github.io/prefix-code/)
44
- [Repository](https://github.com/neri/prefix-code)
55

66
## Features

0 commit comments

Comments
 (0)