generated from freeCodeCamp/template
-
-
Notifications
You must be signed in to change notification settings - Fork 13
57 lines (52 loc) · 1.73 KB
/
mdbook.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
name: Deploy mdBook site to Pages
on:
push:
branches: ["main"]
# only when `docs/` changes
paths: ["docs/**"]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # 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')
mdbook_url="https://github.com/rust-lang/mdbook/releases/download/${tag}/mdbook-${tag}-x86_64-unknown-linux-gnu.tar.gz"
admonish_url="https://github.com/tommilligan/mdbook-admonish/releases/download/v1.14.0/mdbook-admonish-v1.14.0-x86_64-unknown-linux-gnu.tar.gz"
mkdir mdbook
curl -sSL $mdbook_url | tar -xz --directory=./mdbook
curl -sSL $admonish_url | tar -xz --directory=./mdbook
echo `pwd`/mdbook >> $GITHUB_PATH
- name: Build Book
run: |
mdbook build
- name: Setup Pages
uses: actions/configure-pages@b8130d9ab958b325bbde9786d62f2c97a9885a0e # v3
- name: Upload artifact
uses: actions/upload-pages-artifact@a753861a5debcf57bf8b404356158c8e1e33150c # v2
with:
# Upload entire repository
path: "book"
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@de14547edc9944350dc0481aa5b7afb08e75f254 # v2