Skip to content

Commit 9c59fab

Browse files
committed
Add buildInfo.json to static dir
1 parent c34c523 commit 9c59fab

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Diff for: .github/workflows/docs-build-push.yml

+14
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,20 @@ jobs:
195195
hugo-version: ${{env.HUGO_VERSION}}
196196
extended: true
197197

198+
- name: Add hugo build info
199+
if: inputs.doc_type == 'hugo'
200+
run: |
201+
timestamp=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
202+
cat <<EOF > buildInfo.json
203+
{
204+
"nginxHugoThemeVersion": "$THEME_MODULE@$THEME_VERSION",
205+
"buildDate": "$timestamp"
206+
}
207+
EOF
208+
mkdir -p ${{inputs.docs_build_path}}/static/
209+
cp buildInfo.json ${{inputs.docs_build_path}}/static/
210+
211+
198212
- name: Build Hugo for PR preview
199213
if: inputs.doc_type == 'hugo' && (github.event.action == 'synchronize' || github.event.action == 'opened' || env.DEPLOYMENT_ENV == 'preview')
200214
working-directory: ${{inputs.docs_build_path}}

0 commit comments

Comments
 (0)