Skip to content

Commit

Permalink
Add buildInfo.json to static dir
Browse files Browse the repository at this point in the history
  • Loading branch information
nginx-jack committed Oct 10, 2024
1 parent c34c523 commit 9c59fab
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/docs-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<EOF > 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}}
Expand Down

0 comments on commit 9c59fab

Please sign in to comment.