-
Notifications
You must be signed in to change notification settings - Fork 2
43 lines (34 loc) · 1.26 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
name: Deploy
"on":
workflow_dispatch: {}
push:
branches: ["master"]
jobs:
Build:
runs-on: ubuntu-latest
# Ask for a token with the right permissions to publish. It would be slightly
# safer to split into two jobs, so the untrusted mdBook binary does not have
# access to the token, but the worst you can do is deface the webpage which
# a malicious mdBook could do anyway, so we keep the workflow simple.
permissions:
contents: read
pages: write
id-token: write
steps:
- uses: actions/checkout@v4
- name: Install mdBook
run: |
curl -sSL "https://github.com/rust-lang/mdBook/releases/download/$(cat mdbook-version)/mdbook-$(cat mdbook-version)-x86_64-unknown-linux-gnu.tar.gz" | tar -xz
- name: Build and test the book
run: |
./mdbook build
./mdbook test
# Delete large artifacts from the output. It's 2024, everybody supports woff2.
rm -f book/FontAwesome/fonts/fontawesome{-webfont.svg,-webfont.ttf,-webfont.eot,.ttf}
- name: Upload artifact
uses: actions/[email protected]
with:
path: "book"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/[email protected]