Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(lighthouse): include performance badges on ReadMe #80

Merged
merged 4 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/on-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Generate Lighthouse Badges
on:
push:
branches:
- main
jobs:
generate-lighthouse-badges:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Run Lighthouse and generate badges
run: |
make lighthouse-badges

- name: Push badges to repo
run: |
git config --global user.name "GitHub Action"
git config --global user.email "action@github.com"
git add ./docs/lighthouse
git commit -m "Update Lighthouse badges"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .lighthouserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"categories.best-practices" : [
"error",
{
"minScore": 0.95
"minScore": 0.96
}
],
"categories.seo" : [
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ checks: install compile build verify-formatting lint
lighthouse-audit: install build
lhci autorun

lighthouse-badges:
npx lighthouse-badges -o docs/lighthouse/badges -u https://teomrd.github.io/miropad/

clean:
deno clean
rm -rf ./node_modules
Expand Down
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

> Temporary note keeping app for the browser

## Lighthouse Audit scores

[![Lighthouse Performance Badge](./docs/lighthouse/badges/lighthouse_performance.svg)](https://github.com/teomrd/miropad)
[![Lighthouse Accessibility Badge](./docs/lighthouse/badges/lighthouse_accessibility.svg)](https://github.com/teomrd/miropad)
[![Lighthouse Best Practices Badge](./docs/lighthouse/badges/lighthouse_best-practices.svg)](https://github.com/teomrd/miropad)
[![Lighthouse SEO Badge](./docs/lighthouse/badges/lighthouse_seo.svg)](https://github.com/teomrd/miropad)

## Usage

```commands
Expand Down Expand Up @@ -31,6 +38,4 @@ following the pattern.

`git config commit.template ./.gitmessage`

## Lighthouse Audit results

![Lighthouse Audit results](docs/lighthouse-results.gif)
Binary file removed docs/lighthouse-results.gif
Binary file not shown.
1 change: 1 addition & 0 deletions docs/lighthouse/badges/lighthouse_accessibility.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/lighthouse/badges/lighthouse_best-practices.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/lighthouse/badges/lighthouse_performance.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/lighthouse/badges/lighthouse_seo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.