Skip to content

Commit 49e6ed5

Browse files
committed
CI: Add github action to build documentation repo
Go is set to latest, as hugo tend to keep up to date Hugo itself is pinned to 0.134.0 _only_ to match what's in nginx/documentation at the moment. When that repo supports the latest hugo, we should update here also.
1 parent 9f0650a commit 49e6ed5

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

.github/workflows/hugo-build-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Hugo Build Test
1+
name: Latest Hugo Version Build Test
22

33
on:
44
pull_request:
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Build Hugo Docs with PR Theme
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build-docs:
10+
name: Build Hugo Docs with PR Theme
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout hugo theme
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+
- name: Clone documentation repo
20+
run: |
21+
git clone https://github.com/nginx/documentation.git docs
22+
23+
- name: Setup Go
24+
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
25+
with:
26+
go-version: ">=1.23"
27+
28+
- name: Setup Hugo
29+
uses: peaceiris/actions-hugo@75d2e84710de30f6ff7268e08f310b60ef14033f # v3.0.0
30+
with:
31+
hugo-version: "0.134.2"
32+
extended: true
33+
34+
- name: Build Hugo site
35+
working-directory: docs
36+
run: |
37+
hugo --gc -e production --baseURL="https://frontdoor-test-docs.nginx.com/nginx-hugo-theme/${{github.event.pull_request.number}}"

0 commit comments

Comments
 (0)