diff --git a/.github/workflows/hugo-build-test.yml b/.github/workflows/hugo-build-test.yml new file mode 100644 index 0000000..e6a5279 --- /dev/null +++ b/.github/workflows/hugo-build-test.yml @@ -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 diff --git a/Makefile b/Makefile index 3e487a0..89460d1 100644 --- a/Makefile +++ b/Makefile @@ -8,12 +8,13 @@ list help:: @echo "" @echo " list | help: Print these available make targets" @echo "" - @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) @@ -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 diff --git a/biome.json b/biome.json index c59b934..8bb60fc 100644 --- a/biome.json +++ b/biome.json @@ -22,7 +22,9 @@ "**/coveo.css", "**/f5-hugo.css", "**/highlight.css", - "**/*-overrides.css" + "**/*-overrides.css", + + "exampleSite" ] }, "formatter": { diff --git a/exampleSite/go.mod b/exampleSite/go.mod index ebe4ce6..996bf7f 100644 --- a/exampleSite/go.mod +++ b/exampleSite/go.mod @@ -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 => ../