-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (56 loc) · 1.78 KB
/
web.yml
File metadata and controls
67 lines (56 loc) · 1.78 KB
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
name: Deploy
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Load target cache
uses: actions/cache/restore@v4
id: cache-restore
with:
path: |
/home/runner/work/fluidsim/fluidsim/target
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-rust-cache-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-rust-cache
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
default: true
override: true
- name: Install wasm-pack via apt
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Build
run: wasm-pack build --target web --release --locked
- name: Move files around
run: |
mkdir dist
rm pkg/.gitignore
mv pkg dist/
mv index.html dist/
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
- name: Save target cache
if: always() && (steps.cache-restore.outputs.cache-hit != 'true' || steps.cache-restore.outputs.cache-primary-key == '${{ runner.os }}-rust-cache')
uses: actions/cache/save@v4
with:
path: |
/home/runner/work/attendance/attendance/src-api/target
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-rust-cache-${{ hashFiles('**/Cargo.lock') }}