Skip to content

Commit cb6843e

Browse files
committed
Tooling: Add hugo exampleSite build to CI
1 parent 3bc0273 commit cb6843e

File tree

4 files changed

+41
-3
lines changed

4 files changed

+41
-3
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Hugo Build Test
2+
3+
on:
4+
workflow_dispatch:
5+
6+
env:
7+
GO_VERISON: "1.21" # Go version used for `hugo mod get`
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-24.04
12+
13+
steps:
14+
- name: Checkout docs content
15+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.7.1
16+
with:
17+
fetch-depth: 0 # This is required for hugo Lastmod to function properly
18+
19+
### Hugo builds
20+
21+
- name: Setup Go
22+
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
23+
with:
24+
go-version: ${{env.GO_VERISON}}
25+
26+
- name: Setup Hugo
27+
uses: peaceiris/actions-hugo@75d2e84710de30f6ff7268e08f310b60ef14033f # v3.0.0
28+
with:
29+
extended: true
30+
31+
- name: Build Hugo
32+
run: |
33+
make build example site

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ list help::
1313
@echo " biome-all: Runs both the lint and formatting commands."
1414
@echo " (Set BIOME_ARGS to add additional arguments to biome command (ex: make biome-all BIOME_ARGS=write))"
1515

16-
.PHONY: biome-format biome-lint biome-all setup-pre-commit
16+
.PHONY: biome-format biome-lint biome-all setup-pre-commit build-example-site
1717
BIOME_ARGS ?=
1818
FLAG :=
1919
ifeq ($(BIOME_ARGS), write)
@@ -36,3 +36,6 @@ setup-pre-commit:
3636
pre-commit install --hook-type commit-msg; \
3737
echo "pre-commit hooks have been successfully installed."; \
3838
fi
39+
40+
build-example-site:
41+
cd exampleSite && hugo mod get && hugo build --gc -e production

biome.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
"**/coveo.css",
2323
"**/f5-hugo.css",
2424
"**/highlight.css",
25-
"**/*-overrides.css"
25+
"**/*-overrides.css",
26+
27+
"exampleSite"
2628
]
2729
},
2830
"formatter": {

exampleSite/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ module github.com/nginxinc/docs
22

33
go 1.19
44

5-
require github.com/nginxinc/nginx-hugo-theme v0.41.22 // indirect
5+
require github.com/nginxinc/nginx-hugo-theme v0.41.27 // indirect
66

77
replace github.com/nginxinc/nginx-hugo-theme => ../

0 commit comments

Comments
 (0)