Files
metrics/source/plugins/pagespeed/README.md

84 lines
2.9 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
### ⏱️ Website performances
The *pagespeed* plugin adds the performance statistics of the website attached on your account:
<table>
<td align="center">
<details open><summary>PageSpeed scores</summary>
<img src="https://github.com/lowlighter/lowlighter/blob/master/metrics.plugin.pagespeed.svg">
</details>
<details><summary>PageSpeed scores with detailed report</summary>
<img src="https://github.com/lowlighter/lowlighter/blob/master/metrics.plugin.pagespeed.detailed.svg">
</details>
<details><summary>PageSpeed scores with a website screenshot</summary>
<img src="https://github.com/lowlighter/lowlighter/blob/master/metrics.plugin.pagespeed.screenshot.svg">
</details>
<img width="900" height="1" alt="">
</td>
</table>
These metrics are computed through [Google's PageSpeed API](https://developers.google.com/speed/docs/insights/v5/get-started), which yields the same results as [web.dev](https://web.dev).
See [performance scoring](https://web.dev/performance-scoring/) and [score calculator](https://googlechrome.github.io/lighthouse/scorecalc/) for more informations about how PageSpeed compute these statistics.
Although not mandatory, you can generate an API key for PageSpeed API [here](https://developers.google.com/speed/docs/insights/v5/get-started) to avoid hitting rate limiter.
Expect 10 to 30 seconds to generate the results.
#### ➡️ Available options
<!--options-->
| Option | Type *(format)* **[default]** *{allowed values}* | Description |
| ------ | -------------------------------- | ----------- |
| `plugin_pagespeed` | `boolean` **[no]** | Display a website Google PageSpeed metrics |
| `plugin_pagespeed_url` | `string` **[.user.website]** | Audited website |
| `plugin_pagespeed_detailed` | `boolean` **[no]** | Detailed audit result |
| `plugin_pagespeed_screenshot` | `boolean` **[no]** | Display a screenshot of your website |
| `plugin_pagespeed_token` 🔐 | `token` **[]** | PageSpeed token |
Legend for option icons:
* 🔐 Value should be stored in repository secrets
* ✨ New feature currently in testing on `master`/`main`
<!--/options-->
*[→ Full specification](metadata.yml)*
#### Examples workflows
<!--examples-->
```yaml
name: Succint report
uses: lowlighter/metrics@latest
with:
filename: metrics.plugin.pagespeed.svg
token: NOT_NEEDED
plugin_pagespeed: 'yes'
plugin_pagespeed_token: ${{ secrets.PAGESPEED_TOKEN }}
```
```yaml
name: Detailed report
uses: lowlighter/metrics@latest
with:
filename: metrics.plugin.pagespeed.detailed.svg
token: NOT_NEEDED
plugin_pagespeed: 'yes'
plugin_pagespeed_detailed: 'yes'
plugin_pagespeed_token: ${{ secrets.PAGESPEED_TOKEN }}
```
```yaml
name: Screenshot
uses: lowlighter/metrics@latest
with:
filename: metrics.plugin.pagespeed.screenshot.svg
token: NOT_NEEDED
plugin_pagespeed: 'yes'
plugin_pagespeed_screenshot: 'yes'
plugin_pagespeed_token: ${{ secrets.PAGESPEED_TOKEN }}
```
<!--/examples-->