-
Notifications
You must be signed in to change notification settings - Fork 7
79 lines (66 loc) · 2.13 KB
/
publish.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
---
name: Publish
"on":
push:
branches:
- trunk
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
# Build job
build:
name: Build Playground
runs-on: ubuntu-latest
env:
RUSTFLAGS: -D warnings
RUST_BACKTRACE: 1
CARGO_NET_GIT_FETCH_WITH_CLI: true
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
steps:
- name: Checkout repository
uses: actions/[email protected]
- name: Set toolchain versions
run: |
echo "emscripten=$(cat emscripten-toolchain)" >> $GITHUB_OUTPUT
id: toolchain_versions
- name: Install Node.js toolchain
uses: actions/[email protected]
with:
node-version: "lts/*"
# Must install deps before setting up emscripten toolchain since emsdk
# includes its own older node which does not support lockfileversion 3
# in package-lock.json.
- name: Install Node.js dependencies
run: npm ci
- name: Install Rust toolchain
uses: artichoke/setup-rust/[email protected]
with:
toolchain: "1.72.1"
target: "wasm32-unknown-emscripten"
- name: Install Ruby toolchain
uses: ruby/setup-ruby@1198b074305f9356bd56dd4b311757cc0dab2f1c # v1.175.1
with:
ruby-version: ".ruby-version"
bundler-cache: true
- name: Install Emscripten toolchain
uses: mymindstorm/setup-emsdk@6ab9eb1bda2574c4ddb79809fc9247783eaf9021 # v14
with:
version: ${{ steps.toolchain_versions.outputs.emscripten }}
no-cache: true
- name: Verify emcc version
run: emcc -v
- name: Compile Wasm
run: ruby scripts/build-wasm.rb --release --verbose
- name: Build Webapp
run: npm run build
# Publish step
- name: Deploy Playground
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v3.9.2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
publish_branch: gh-pages
cname: artichoke.run
user_name: artichoke-ci
user_email: [email protected]