-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (37 loc) · 1.19 KB
/
hugo-build-profile.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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>`
});