-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (37 loc) · 1.03 KB
/
deploy-pages.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
name: Publish to GitHub Pages
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
actions: read
contents: write
pages: write
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install mdBook
run: |
mkdir mdbook
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.23/mdbook-v0.4.23-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
echo `pwd`/mdbook >> $GITHUB_PATH
- name: Build
run: mdbook build
- name: Deploy to GitHub Pages
run: |
git worktree add gh-pages gh-pages
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
cd gh-pages
rm -rf latest
mkdir latest
mv ../book/* ./latest
git add .
if ! git diff --cached --exit-code > /dev/null; then
git commit -m "Render mdBook for $GITHUB_SHA"
git push
fi