From 9c59fab05a8131f4d691ba6ea2b6a119f3ef832a Mon Sep 17 00:00:00 2001 From: Jack Hickey Date: Tue, 8 Oct 2024 14:21:16 +0100 Subject: [PATCH] Add buildInfo.json to static dir --- .github/workflows/docs-build-push.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/docs-build-push.yml b/.github/workflows/docs-build-push.yml index 1068901..69ec8e3 100644 --- a/.github/workflows/docs-build-push.yml +++ b/.github/workflows/docs-build-push.yml @@ -195,6 +195,20 @@ jobs: hugo-version: ${{env.HUGO_VERSION}} extended: true + - name: Add hugo build info + if: inputs.doc_type == 'hugo' + run: | + timestamp=$(date -u +'%Y-%m-%dT%H:%M:%SZ') + cat < buildInfo.json + { + "nginxHugoThemeVersion": "$THEME_MODULE@$THEME_VERSION", + "buildDate": "$timestamp" + } + EOF + mkdir -p ${{inputs.docs_build_path}}/static/ + cp buildInfo.json ${{inputs.docs_build_path}}/static/ + + - name: Build Hugo for PR preview if: inputs.doc_type == 'hugo' && (github.event.action == 'synchronize' || github.event.action == 'opened' || env.DEPLOYMENT_ENV == 'preview') working-directory: ${{inputs.docs_build_path}}