Create index.md #1066
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Capture Hugo Build Stats | |
on: [ pull_request ] | |
jobs: | |
build: | |
name: Save hugo build stats | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: install hugo with asdf as defined in .tool-versions manifest | |
uses: asdf-vm/actions/install@v1 | |
- name: build hugo site and capture build stats | |
id: hugo_stats | |
run: hugo --templateMetrics > hugo-build-stats.txt | |
- uses: actions/github-script@v6 | |
with: | |
script: | | |
let hugoStats = ''; | |
const options = {}; | |
options.listeners = { | |
stdout: (data) => { | |
hugoStats += data.toString(); | |
} | |
}; | |
await exec.exec('cat', ['hugo-build-stats.txt'], options); | |
github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: ` | |
<details> | |
<summary><strong>Hugo Build Profile</strong></summary> | |
~~~ | |
${hugoStats} | |
~~~ | |
</details>` | |
}); | |