-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (48 loc) · 1.35 KB
/
github-pages.yml
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
name: GitHub Pages
on:
push:
branches: [main, master]
workflow_dispatch:
concurrency:
group: github-pages-${{ github.ref }}
cancel-in-progress: true
jobs:
build_and_deploy_github_pages:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install rust nightly
uses: actions-rs/toolchain@v1
with:
target: wasm32-unknown-unknown
toolchain: nightly
override: true
- name: Install wasm-pack
run: curl -sSf https://rustwasm.github.io/wasm-pack/installer/init.sh | sh
- name: Cache target
id: cache-target
uses: actions/cache@v3
with:
path: target
key: ${{ runner.os }}-target
- name: Cache node_modules
id: cache-node_modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-node_modules
- name: Install npm packages
run: npm install
- name: Build wasm
run: npm run build:wasm
- name: Build wasm and frontend
run: npm run build
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist