-
Notifications
You must be signed in to change notification settings - Fork 103
114 lines (92 loc) · 2.97 KB
/
Copy pathdocs-site.yml
File metadata and controls
114 lines (92 loc) · 2.97 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Docs Site
on:
push:
tags:
- "v*"
workflow_dispatch:
# Branch push and pull request triggers are intentionally omitted. Version tags
# keep docs in step with stable builds, and workflow_dispatch lets maintainers
# publish small main-branch docs edits without waiting for another release.
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
name: Build docs site
runs-on: ubuntu-latest
env:
GO_VERSION: "1.25.3"
HUGO_VERSION: "0.160.0"
NODE_VERSION: "24"
steps:
- name: Check out repository
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: |
go.sum
site/go.sum
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
cache-dependency-path: site/package-lock.json
- name: Set up Pages
id: pages
if: ${{ vars.DOCS_SITE_DEPLOY_ENABLED == 'true' }}
uses: actions/configure-pages@v6
- name: Install Hugo
run: |
mkdir -p "${HOME}/.local/hugo"
curl -sL "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz" \
| tar -xz -C "${HOME}/.local/hugo"
echo "${HOME}/.local/hugo" >> "${GITHUB_PATH}"
- name: Install Node.js dependencies
working-directory: site
run: npm ci
- name: Check generated docs
run: go run ./cmd/restish-docgen --check
- name: Generate social preview images
working-directory: site
run: npm run social-images
- name: Build site
if: ${{ vars.DOCS_SITE_DEPLOY_ENABLED != 'true' }}
run: |
hugo --source site --quiet --gc --minify \
--cacheDir "${{ runner.temp }}/hugo_cache"
- name: Build Pages artifact
if: ${{ vars.DOCS_SITE_DEPLOY_ENABLED == 'true' }}
run: |
hugo --source site --quiet --gc --minify \
--baseURL "${{ steps.pages.outputs.base_url }}/" \
--cacheDir "${{ runner.temp }}/hugo_cache"
- name: Check docs links
run: scripts/check-doc-links.rb
- name: Check docs examples
run: scripts/check-doc-examples.rb
- name: Upload Pages artifact
if: ${{ vars.DOCS_SITE_DEPLOY_ENABLED == 'true' }}
uses: actions/upload-pages-artifact@v5
with:
path: site/public
deploy:
name: Deploy docs site
if: ${{ vars.DOCS_SITE_DEPLOY_ENABLED == 'true' }}
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5