Skip to content

Commit

Permalink
Merge pull request #80 from teomrd/lighthouse-badges
Browse files Browse the repository at this point in the history
feat(lighthouse): include performance badges on ReadMe
  • Loading branch information
teomrd authored Nov 13, 2024
2 parents dd1ca69 + dbb7681 commit 0dd6359
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 3 deletions.
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.

0 comments on commit 0dd6359

Please sign in to comment.