-
-
Notifications
You must be signed in to change notification settings - Fork 94
46 lines (44 loc) · 1.62 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
name: Deployments
on:
push:
tags:
- zbus-5.*
paths:
- book/**/*
- .github/workflows/deploy.yml
jobs:
book:
runs-on: ubuntu-latest
permissions:
contents: write # To push a branch
pull-requests: write # To create a PR from that branch
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- 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: Install latest mdbook-toc
run: |
tag=$(curl 'https://api.github.com/repos/badboy/mdbook-toc/releases/latest' | jq -r '.tag_name')
url="https://github.com/badboy/mdbook-toc/releases/download/${tag}/mdbook-toc-${tag}-x86_64-unknown-linux-gnu.tar.gz"
mkdir mdbook-toc
curl -sSL $url | tar -xz --directory=./mdbook-toc
echo `pwd`/mdbook-toc >> $GITHUB_PATH
- name: Build Books
run: |
mdbook build book
mkdir public
cp -r ./book/book/* ./public
# link to the old name for service
ln -rs public/service.html public/server.html
- name: Deploy 🚀
uses: JamesIves/[email protected]
with:
branch: gh-pages # The branch the action should deploy to.
folder: public # The folder the action should deploy.