-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (76 loc) · 2.44 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
68
69
70
71
72
73
74
75
76
77
name: Deploy
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write # To push a branch
pages: write # To push to a GitHub Pages site
id-token: write # To update the deployment status
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
components: rustfmt, clippy
target: wasm32-unknown-unknown
- name: Install latest mdbook
run: |
tag=$(curl 'https://api.github.com/repos/rust-lang/mdbook/releases/latest' | jq -r '.tag_name')
url="https://github.com/rust-lang/mdbook/releases/download/${tag}/mdbook-${tag}-x86_64-unknown-linux-gnu.tar.gz"
mkdir mdbook
curl -sSL $url | tar -xz --directory=./mdbook
echo `pwd`/mdbook >> $GITHUB_PATH
- name: Build Book
run: |
cd book
mdbook build
- name: Build docs
uses: actions-rs/cargo@v1
with:
command: doc
args: --no-deps --all-features
- name: Make dist folder
run: |
mkdir dist
- name: Copy docs
run: |
mkdir dist/doc
cp -r target/doc dist
- name: Copy book
run: |
mkdir dist/book
cp -r book/book dist
- name: Copy homepage
run: |
cp book/banner.webp dist/banner.webp
cp book/landing.html dist/index.html
- name: Download and install Trunk binary
working-directory: crates/games-ui
run: wget -qO- https://github.com/thedodd/trunk/releases/latest/download/trunk-x86_64-unknown-linux-gnu.tar.gz | tar -xzf-
- name: Build Web App
run: ./trunk build --release --public-url $public_url
working-directory: crates/games-ui
env:
public_url: "https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/app"
- name: Copy Web App
run: |
mkdir dist/app
cp -r ./crates/games-ui/dist/* dist/app
- name: Setup Pages
uses: actions/configure-pages@v2
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
# Upload entire repository
path: 'dist'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1