Skip to content

Tooling: Add hugo exampleSite build to CI #148

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/hugo-build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Hugo Build Test

on:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-24.04

steps:
- name: Checkout docs content
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.7.1
with:
fetch-depth: 0 # This is required for hugo Lastmod to function properly

### Hugo builds

- name: Setup Go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: 'latest'

- name: Setup Hugo
uses: peaceiris/actions-hugo@75d2e84710de30f6ff7268e08f310b60ef14033f # v3.0.0
with:
hugo-version: 'latest'
extended: true

- name: Build Hugo
run: |
make build-example-site
12 changes: 8 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ list help::
@echo "<COMMON>"
@echo " list | help: Print these available make targets"
@echo "<LINTING AND FORMATTING>"
@echo " biome-format: Runs the biome formatter."
@echo " biome-lint: Runs the biome linter."
@echo " biome-all: Runs both the lint and formatting commands."
@echo " biome-format: Runs the biome formatter."
@echo " biome-lint: Runs the biome linter."
@echo " biome-all: Runs both the lint and formatting commands."
@echo "build-example-site: Builds hugo exampleSite."
@echo " (Set BIOME_ARGS to add additional arguments to biome command (ex: make biome-all BIOME_ARGS=write))"

.PHONY: biome-format biome-lint biome-all setup-pre-commit
.PHONY: biome-format biome-lint biome-all setup-pre-commit build-example-site
BIOME_ARGS ?=
FLAG :=
ifeq ($(BIOME_ARGS), write)
Expand All @@ -36,3 +37,6 @@ setup-pre-commit:
pre-commit install --hook-type commit-msg; \
echo "pre-commit hooks have been successfully installed."; \
fi

build-example-site:
cd exampleSite && hugo mod get && hugo build --gc -e production
4 changes: 3 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
"**/coveo.css",
"**/f5-hugo.css",
"**/highlight.css",
"**/*-overrides.css"
"**/*-overrides.css",

"exampleSite"
]
},
"formatter": {
Expand Down
4 changes: 2 additions & 2 deletions exampleSite/go.mod
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module github.com/nginxinc/docs

go 1.19
go 1.23

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

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