-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgithub-actions.yml
More file actions
74 lines (61 loc) · 2.35 KB
/
github-actions.yml
File metadata and controls
74 lines (61 loc) · 2.35 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# .github/workflows/lighthouse.yml
#
# Lighthouse Guard — Standard Setup with Slack + Schedule
# ─────────────────────────────────────────────────────────
# 1. Copy to .github/workflows/lighthouse.yml
# 2. Replace https://your-site.com with your URLs
# 3. Add SLACK_WEBHOOK to Settings → Secrets → Actions (optional)
# 4. Push
name: Lighthouse Performance Check
on:
pull_request:
branches: [main, master]
push:
branches: [main, master]
schedule:
- cron: '0 9 * * 1' # Every Monday at 09:00 UTC
jobs:
lighthouse:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Chrome
uses: browser-actions/setup-chrome@v1
with:
chrome-version: stable
- name: Run Lighthouse Guard
uses: yasinatesim/lighthouse-guard@v1
id: lighthouse
with:
urls: |
[
{"url": "https://your-site.com/", "name": "Home"},
{"url": "https://your-site.com/about", "name": "About"},
{"url": "https://your-site.com/blog", "name": "Blog"},
{"url": "https://your-site.com/contact", "name": "Contact"}
]
# 3 measurements → median score (eliminates outliers)
runs: 3
strategy: median
devices: mobile,desktop
# Pipeline breaks if any score falls below these values
performance-threshold: 80
accessibility-threshold: 90
seo-threshold: 85
best-practices-threshold: 80
fail-on-threshold: true
# Ban protection: random jitter added automatically (+0-30%)
delay-between-runs: 10000
delay-between-pages: 15000
max-retries: 3
# Slack notification (add SLACK_WEBHOOK to repo secrets)
slack-webhook: ${{ secrets.SLACK_WEBHOOK }}
# Posts score table as a PR comment
github-token: ${{ github.token }}
# Dashboard → Actions → Artifacts → lighthouse-dashboard → open index.html
upload-dashboard: true
- name: Show Results
if: always()
run: |
echo "passed : ${{ steps.lighthouse.outputs.passed }}"
echo "summary : ${{ steps.lighthouse.outputs.summary }}"