-
Notifications
You must be signed in to change notification settings - Fork 78
78 lines (74 loc) · 2.82 KB
/
github-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
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
name: GitHub Pages
on:
push:
tags-ignore:
- '**'
paths:
- "Pages/**"
- "README.md"
- "CHANGELOG.md"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
permissions:
contents: write
pages: write
id-token: write
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: DavidAnson/markdownlint-cli2-action@v16
with:
globs: Pages/**.md
build:
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install mdbook and its preprocessors
run: |
mkdir mdbook
tag=$(curl 'https://api.github.com/repos/toolmanp/rs-mdbook-callouts/releases/latest' | jq -r '.tag_name')
url="https://github.com/toolmanp/rs-mdbook-callouts/releases/download/${tag}/mdbook-callouts-${tag}-x86_64-unknown-linux-gnu.tar.gz"
curl -sSL $url | tar -xz --directory=./mdbook
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"
curl -sSL $url | tar -xz --directory=./mdbook
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"
curl -sSL $url | tar -xz --directory=./mdbook
tag=$(curl 'https://api.github.com/repos/badboy/mdbook-last-changed/releases/latest' | jq -r '.tag_name')
url="https://github.com/badboy/mdbook-last-changed/releases/download/${tag}/mdbook-last-changed-${tag}-x86_64-unknown-linux-gnu.tar.gz"
curl -sSL $url | tar -xz --directory=./mdbook
tag=$(curl 'https://api.github.com/repos/toolmanp/mdbook-mermaid/releases/latest' | jq -r '.tag_name')
url="https://github.com/toolmanp/mdbook-mermaid/releases/download/${tag}/mdbook-mermaid-${tag}-x86_64-unknown-linux-gnu.tar.gz"
curl -sSL $url | tar -xz --directory=./mdbook
echo `pwd`/mdbook >> $GITHUB_PATH
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Build Book
run: |
mdbook-mermaid install ./
mdbook build
touch ./book/.nojekyll
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: "book"
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@v4