From 9ed9ee7c924a50cbd46e2a3d200940e0f6daf31d Mon Sep 17 00:00:00 2001 From: Jack Hickey <133868041+nginx-jack@users.noreply.github.com> Date: Thu, 27 Feb 2025 11:24:24 +0000 Subject: [PATCH] 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. --- .github/workflows/hugo-build-test.yml | 2 +- .../workflows/nginx-documentation-build.yml | 37 +++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/nginx-documentation-build.yml diff --git a/.github/workflows/hugo-build-test.yml b/.github/workflows/hugo-build-test.yml index 43976f5..705018c 100644 --- a/.github/workflows/hugo-build-test.yml +++ b/.github/workflows/hugo-build-test.yml @@ -1,4 +1,4 @@ -name: Hugo Build Test +name: Latest Hugo Version Build Test on: pull_request: diff --git a/.github/workflows/nginx-documentation-build.yml b/.github/workflows/nginx-documentation-build.yml new file mode 100644 index 0000000..fd7c986 --- /dev/null +++ b/.github/workflows/nginx-documentation-build.yml @@ -0,0 +1,37 @@ +name: Build Hugo Docs with PR Theme + +on: + pull_request: + branches: + - main + +jobs: + build-docs: + name: Build Hugo Docs with PR Theme + runs-on: ubuntu-latest + + steps: + - name: Checkout hugo theme + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.7.1 + with: + fetch-depth: 0 # This is required for hugo Lastmod to function properly + + - name: Clone documentation repo + run: | + git clone https://github.com/nginx/documentation.git docs + + - name: Setup Go + uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 + with: + go-version: ">=1.23" + + - name: Setup Hugo + uses: peaceiris/actions-hugo@75d2e84710de30f6ff7268e08f310b60ef14033f # v3.0.0 + with: + hugo-version: "0.134.2" + extended: true + + - name: Build Hugo site + working-directory: docs + run: | + hugo --gc -e production --baseURL="https://frontdoor-test-docs.nginx.com/nginx-hugo-theme/${{github.event.pull_request.number}}"