diff --git a/.github/workflows/on-main.yml b/.github/workflows/on-main.yml
new file mode 100644
index 00000000..7c476c32
--- /dev/null
+++ b/.github/workflows/on-main.yml
@@ -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 }}
\ No newline at end of file
diff --git a/.lighthouserc.json b/.lighthouserc.json
index ade46d14..7f508bb9 100644
--- a/.lighthouserc.json
+++ b/.lighthouserc.json
@@ -23,7 +23,7 @@
"categories.best-practices" : [
"error",
{
- "minScore": 0.95
+ "minScore": 0.96
}
],
"categories.seo" : [
diff --git a/Makefile b/Makefile
index 37d0d566..668f8bc6 100644
--- a/Makefile
+++ b/Makefile
@@ -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
diff --git a/README.md b/README.md
index 76620992..da63de8c 100644
--- a/README.md
+++ b/README.md
@@ -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
@@ -31,6 +38,4 @@ following the pattern.
`git config commit.template ./.gitmessage`
-## Lighthouse Audit results
-![Lighthouse Audit results](docs/lighthouse-results.gif)
\ No newline at end of file
diff --git a/docs/lighthouse-results.gif b/docs/lighthouse-results.gif
deleted file mode 100644
index 2d21d908..00000000
Binary files a/docs/lighthouse-results.gif and /dev/null differ
diff --git a/docs/lighthouse/badges/lighthouse_accessibility.svg b/docs/lighthouse/badges/lighthouse_accessibility.svg
new file mode 100644
index 00000000..66780661
--- /dev/null
+++ b/docs/lighthouse/badges/lighthouse_accessibility.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/docs/lighthouse/badges/lighthouse_best-practices.svg b/docs/lighthouse/badges/lighthouse_best-practices.svg
new file mode 100644
index 00000000..a65fba4c
--- /dev/null
+++ b/docs/lighthouse/badges/lighthouse_best-practices.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/docs/lighthouse/badges/lighthouse_performance.svg b/docs/lighthouse/badges/lighthouse_performance.svg
new file mode 100644
index 00000000..1268e55a
--- /dev/null
+++ b/docs/lighthouse/badges/lighthouse_performance.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/docs/lighthouse/badges/lighthouse_seo.svg b/docs/lighthouse/badges/lighthouse_seo.svg
new file mode 100644
index 00000000..a4ca8dbd
--- /dev/null
+++ b/docs/lighthouse/badges/lighthouse_seo.svg
@@ -0,0 +1 @@
+
\ No newline at end of file