-
Notifications
You must be signed in to change notification settings - Fork 220
120 lines (100 loc) · 2.82 KB
/
website.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: Website
on:
push:
branches:
- master
pull_request:
env:
RUSTFLAGS: -Cdebuginfo=0
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: 1
jobs:
Tutorials:
name: Doc Tutorials
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: docs/tutorials
- name: Build Books
uses: taiki-e/install-action@v2
with:
tool: mdbook@0.4.37
- run: mdbook build docs/tutorials --dest-dir ${GITHUB_WORKSPACE}/public/docs/tutorials
- uses: actions/upload-artifact@v4
with:
name: Doc Tutorials
path: public/docs/tutorials
Rust-API:
name: Doc Rust API
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
components: rust-docs
- name: Build API Doc
env:
FEATURES: parallel serde derive uuid_entity storage-event-control
run: cargo doc --all --features "${FEATURES}" # --no-deps
- uses: actions/upload-artifact@v4
with:
name: Doc Rust API
path: |
target/doc
Website:
name: Doc Website
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
docs/website
- name: Find Base Url
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Use the API to retrieve the github pages url and set an environment variable containing the value.
run: echo "GITHUB_PAGES_URL=$(gh api "repos/$GITHUB_REPOSITORY/pages" --jq '.html_url')" >> $GITHUB_ENV
- uses: taiki-e/install-action@v2
with:
tool: zola@0.18.0
- run: zola build --base-url $GITHUB_PAGES_URL
working-directory: docs/website
- uses: actions/upload-artifact@v4
with:
name: Doc Zola
path: docs/website/public
Deploy:
name: Deploy
runs-on: ubuntu-latest
needs: [ Tutorials, Rust-API, Website ]
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
if: github.event_name != 'pull_request'
steps:
- uses: actions/download-artifact@v4
with:
name: Doc Tutorials
path: public/docs/tutorials
- uses: actions/download-artifact@v4
with:
name: Doc Rust API
path: public/docs/api
- uses: actions/download-artifact@v4
with:
name: Doc Zola
path: public
- uses: actions/upload-pages-artifact@v3
with:
path: public
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4