-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (77 loc) · 2.51 KB
/
Copy pathdocs.yml
File metadata and controls
87 lines (77 loc) · 2.51 KB
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
79
80
81
82
83
84
85
86
87
name: Docs
on:
push:
# develop = DEV (build only); main = PRD (build + deploy).
branches: [develop, main]
paths:
# Book inputs only. docs/design/ is not part of the book, so editing a design
# document must not trigger a site build; its links are checked in quality.yml.
- "docs/src/**"
- "docs/book.toml"
- "docs/preprocessors/**"
- "docs/mermaid.min.js"
- "docs/mermaid-init.js"
- "docs/wrangler.toml"
- ".github/workflows/docs.yml"
pull_request:
paths:
# Book inputs only. docs/design/ is not part of the book, so editing a design
# document must not trigger a site build; its links are checked in quality.yml.
- "docs/src/**"
- "docs/book.toml"
- "docs/preprocessors/**"
- "docs/mermaid.min.js"
- "docs/mermaid-init.js"
- "docs/wrangler.toml"
- ".github/workflows/docs.yml"
workflow_dispatch:
permissions:
contents: read
deployments: write
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: docs
steps:
- uses: actions/checkout@v4
- name: Setup mdBook
uses: peaceiris/actions-mdbook@v2
with:
mdbook-version: "0.4.40"
- name: Setup mdbook-mermaid
# 0.16.2 is the newest release compatible with mdBook 0.4.40
# (0.17.0 targets the mdBook 0.5 JSON protocol and fails to parse).
run: |
mkdir -p "$HOME/.local/bin"
curl -sSfL "https://github.com/badboy/mdbook-mermaid/releases/download/v0.16.2/mdbook-mermaid-v0.16.2-x86_64-unknown-linux-gnu.tar.gz" \
| tar -xz -C "$HOME/.local/bin"
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- name: Build
run: mdbook build
- name: Upload built site
uses: actions/upload-artifact@v4
with:
name: mdbook-site
path: docs/book
deploy:
needs: build
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
environment:
name: cloudflare-workers
url: https://docs.verityclient.com
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: mdbook-site
path: docs/book
- name: Deploy to Cloudflare Workers (Static Assets)
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
workingDirectory: docs
command: deploy