-
Notifications
You must be signed in to change notification settings - Fork 5
67 lines (58 loc) · 1.67 KB
/
deploy.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
62
63
64
65
66
67
name: deploy
on:
push:
branches: [main]
env:
CARGO_TERM_COLOR: always
jobs:
asteroids:
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- run: cargo build --release --package asteroids --target wasm32-unknown-unknown --manifest-path=asteroids/Cargo.toml
- run: mv ./target/wasm32-unknown-unknown/release/asteroids.wasm ./asteroids/public
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: asteroids
path: asteroids/public
guide:
runs-on: ubuntu-20.04
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v2
- name: Setup mdBook
uses: peaceiris/actions-mdbook@v1
with:
mdbook-version: "latest"
- run: mdbook build guide
- name: Upload Artefact
uses: actions/upload-artifact@v4
with:
name: guide
path: guide/book
deploy:
runs-on: ubuntu-latest
needs: [asteroids, guide]
if: github.event_name == 'push' && ${{ github.ref == 'refs/heads/main' }}
steps:
- name: Download guide
uses: actions/download-artifact@v4
with:
name: guide
path: dist/guide
- name: Download asteroids
uses: actions/download-artifact@v4
with:
name: asteroids
path: dist/asteroids
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist