forked from lobehub/lobe-chat
-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (68 loc) · 2.91 KB
/
lighthouse.yml
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
name: Lighthouse Badger
env:
TOKEN_NAME: 'GH_TOKEN'
REPO_BRANCH: 'lobehub/lobe-chat lighthouse'
USER_NAME: 'lobehubbot'
USER_EMAIL: '[email protected]'
AUDIT_TYPE: 'both'
MOBILE_LIGHTHOUSE_PARAMS: '--throttling.cpuSlowdownMultiplier=2'
DESKTOP_LIGHTHOUSE_PARAMS: '--preset=desktop --throttling.cpuSlowdownMultiplier=1'
COMMIT_MESSAGE: '🤖 chore: Lighthouse Results Refreshed'
on:
schedule:
- cron: '0 0 * * *' # every day
workflow_dispatch:
jobs:
lighthouse-badger-advanced:
name: ${{ matrix.NAME }}
runs-on: ubuntu-22.04
timeout-minutes: 8
strategy:
fail-fast: false
matrix:
include:
- NAME: 'LobeChat | Welcome'
URLS: 'https://chat-preview.lobehub.com/welcome'
BADGES_ARGS: '-b pagespeed -o lighthouse/welcome -r'
COMMIT_MESSAGE: '🤖 chore: Lighthouse Results | Welcome'
- NAME: 'LobeChat | Chat'
URLS: 'https://chat-preview.lobehub.com/chat'
BADGES_ARGS: '-b pagespeed -o lighthouse/chat -r'
COMMIT_MESSAGE: '🤖 chore: Lighthouse Results | Chat'
- NAME: 'LobeChat | Market'
URLS: 'https://chat-preview.lobehub.com/market'
BADGES_ARGS: '-b pagespeed -o lighthouse/market -r'
COMMIT_MESSAGE: '🤖 chore: Lighthouse Results | Market'
- NAME: 'LobeChat | Settings'
URLS: 'https://chat-preview.lobehub.com/settings'
BADGES_ARGS: '-b pagespeed -o lighthouse/settings -r'
COMMIT_MESSAGE: '🤖 chore: Lighthouse Results | Settings'
steps:
- name: Preparatory Tasks
run: |
REPOSITORY=`expr "${{ env.REPO_BRANCH }}" : "\([^ ]*\)"`
BRANCH=`expr "${{ env.REPO_BRANCH }}" : ".* \([^ ]*\)"`
echo "REPOSITORY=$REPOSITORY" >> $GITHUB_ENV
echo "BRANCH=$BRANCH" >> $GITHUB_ENV
env:
REPO_BRANCH: ${{ matrix.REPO_BRANCH || env.REPO_BRANCH }}
- uses: actions/checkout@v4
with:
repository: ${{ env.REPOSITORY }}
token: ${{ secrets[matrix.TOKEN_NAME] || secrets[env.TOKEN_NAME] }}
ref: ${{ env.BRANCH }}
- uses: actions/checkout@v4
with:
repository: 'myactionway/lighthouse-badges'
path: temp_lighthouse_badges_nested
- uses: myactionway/[email protected]
with:
urls: ${{ matrix.URLS }}
badges_args: ${{ matrix.BADGES_ARGS }}
audit_type: ${{ matrix.AUDIT_TYPE || env.AUDIT_TYPE }}
mobile_lighthouse_params: ${{ matrix.MOBILE_LIGHTHOUSE_PARAMS || env.MOBILE_LIGHTHOUSE_PARAMS }}
desktop_lighthouse_params: ${{ matrix.DESKTOP_LIGHTHOUSE_PARAMS || env.DESKTOP_LIGHTHOUSE_PARAMS }}
user_name: ${{ matrix.USER_NAME || env.USER_NAME }}
user_email: ${{ matrix.USER_EMAIL || env.USER_EMAIL }}
commit_message: ${{ matrix.COMMIT_MESSAGE || env.COMMIT_MESSAGE }}
max_push_attempts: 5