-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (75 loc) · 2.85 KB
/
Copy pathci.yml
File metadata and controls
86 lines (75 loc) · 2.85 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
name: CI
# Validates every push and pull request: a strict Hugo build (warnings fail the
# build) plus an internal link / image / anchor check. Deterministic — no external
# network checks, so it never goes red on a third-party hiccup.
on:
push:
branches-ignore: [main] # main is covered by deploy.yml's build step
pull_request:
workflow_dispatch:
permissions:
contents: read
defaults:
run:
shell: bash
jobs:
build-and-check:
runs-on: ubuntu-latest
env:
HTMLTEST_VERSION: "0.17.0"
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
fetch-depth: 0
persist-credentials: false # zizmor: artipacked
- name: Install Hugo (extended)
run: |
HUGO_VERSION="$(cat .hugoversion)" # single source of truth (see also deploy.yml)
wget -O "${{ runner.temp }}/hugo.deb" \
"https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb"
sudo dpkg -i "${{ runner.temp }}/hugo.deb"
- name: Build (strict — warnings are errors)
env:
HUGO_ENVIRONMENT: production
TZ: UTC
run: hugo --gc --minify --panicOnWarning --baseURL "http://localhost/"
- name: Install htmltest (pinned GitHub release)
run: |
curl -fsSL \
"https://github.com/wjdp/htmltest/releases/download/v${HTMLTEST_VERSION}/htmltest_${HTMLTEST_VERSION}_linux_amd64.tar.gz" \
-o "${{ runner.temp }}/htmltest.tar.gz"
tar -xzf "${{ runner.temp }}/htmltest.tar.gz" -C "${{ runner.temp }}" htmltest
install "${{ runner.temp }}/htmltest" /usr/local/bin/htmltest
- name: Check internal links, anchors & images
run: htmltest
format:
name: Format & lint (Prettier + markdownlint)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false # zizmor: artipacked
- name: Setup Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "22"
cache: npm
- name: Install toolchain (pinned via package-lock.json)
run: npm ci
- name: Prettier (check mode)
run: npm run format:check
- name: markdownlint
run: npm run lint:md
spell:
name: Spell check (codespell)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false # zizmor: artipacked
# pipx is preinstalled on ubuntu runners. Config + dictionary: .codespellrc / .codespell-ignore.
- name: Run codespell
run: pipx run codespell==2.4.2 .