Skip to content

Commit c57fb0f

Browse files
committed
CI: Add github action to build documentation repo
1 parent b5902e6 commit c57fb0f

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
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: "latest"
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)