-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (66 loc) · 2.1 KB
/
docs.yaml
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
---
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: "Docs"
on:
workflow_dispatch:
push:
branches: ["main"]
paths:
- .github/workflows/docs.yaml
- docs/**
- README.md
permissions:
actions: write
contents: read
id-token: write
pages: write
jobs:
build:
name: Build Docs
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- name: Generate Token
uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1
id: app-token
with:
app-id: "${{ secrets.BOT_APP_ID }}"
private-key: "${{ secrets.BOT_APP_PRIVATE_KEY }}"
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
token: "${{ steps.app-token.outputs.token }}"
- name: Setup Pages
id: pages
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5
with:
token: "${{ steps.app-token.outputs.token }}"
enablement: true
- name: Build docs
uses: docker://ghcr.io/bjw-s-labs/mdbook:0.4.40@sha256:45d5e892790f6ab94820f602a277fe6e0730b50daa4663f83b8ae9d369ca75fc
with:
args: mdbook build docs
- name: Upload artifact
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3
with:
path: ./docs/book/html
publish:
name: Publish Docs
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Generate Token
uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1
id: app-token
with:
app-id: "${{ secrets.BOT_APP_ID }}"
private-key: "${{ secrets.BOT_APP_PRIVATE_KEY }}"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4
with:
token: "${{ steps.app-token.outputs.token }}"