-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (44 loc) · 1.28 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
name: Deploy to GitHub Pages
on:
push:
branches:
- main
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
PROJECT_TRUNK_VERSION: 'v0.17.5'
# Specify the primary crate of the project.
RUST_PRIMARY_CRATE: swim
jobs:
check:
uses: ./.github/workflows/check.yml
build-deploy:
name: Build and Deploy
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: Swatinem/rust-cache@v2
- name: Install Rust
run: rustup show
- name: Install trunk
uses: jetli/[email protected]
with:
version: ${{ env.PROJECT_TRUNK_VERSION }}
- name: Install Tailwind CSS
run: npm install -g tailwindcss
- name: Build
run: trunk build --release --public-url /${{ github.event.repository.name }}
- name: Create documentation
run: cargo doc --release
- name: Merge documentation
run: |
rm -rf ./dist/docs
echo "<meta http-equiv=\"refresh\" content=\"0; url=$RUST_PRIMARY_CRATE\">" > ./target/doc/index.html
mkdir ./dist/docs
cp -r ./target/doc ./dist
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist