-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (59 loc) · 1.78 KB
/
deploy.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
name: Deploy Rust Project to GitHub Pages
on:
push:
branches:
- master
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Cache Rust dependencies
uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install Node.js and npm
run: |
curl -sL https://deb.nodesource.com/setup_18.x | bash -
apt-get install -y nodejs
apt-get install -y npm
- name: Install nodejs deps
run: |
cd app
npm install
cd ..
- name: Install minimal nightly with clippy and rustfmt
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
components: rustfmt, clippy
- name: Install cargo-generate
run: cargo generate --version || cargo install cargo-generate
- name: Install trunk
run: trunk --version || cargo install trunk
# rustfmt just broken?
# - name: Run rustfmt
# run: cargo fmt --all -- --check
- name: Run clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Add wasm target
run: rustup target add wasm32-unknown-unknown
- name: Build Rust project with trunk
run: trunk build
- name: Copy CNAME for custom domain
run: cp CNAME ./dist/
- name: Create 404 redirection for SPA
run: cp dist/index.html dist/404.html
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.PAT }}
publish_dir: ./dist