-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (57 loc) · 2.65 KB
/
lighthouse-badger.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
# Lighthouse-Badger-Easy | GitHub Action Workflow
#
# Description: Generates, adds & updates manually/automatically Lighthouse badges & reports from one/multiple input URL(s) to the current repository & main branch with minimal settings
# Author: Sitdisch
# Source: https://github.com/myactionway/lighthouse-badger-workflows
# License: MIT
# Copyright (c) 2021 Sitdisch
name: "Lighthouse Badger"
########################################################################
# DEFINE YOUR INPUTS AND TRIGGERS IN THE FOLLOWING
########################################################################
# INPUTS as Secrets (env) for not manually triggered workflows
env:
URLS: https://george-gca.github.io/multi-language-al-folio/
TOKEN_NAME: ${{ secrets.LIGHTHOUSE_BADGER_TOKEN_SECRET }}
# If any of the following env is blank, a default value is used instead
REPO_BRANCH: "${{ github.repository }} main" # target repository & branch e.g. 'dummy/mytargetrepo main'
MOBILE_LIGHTHOUSE_PARAMS: "--only-categories=performance,accessibility,best-practices,seo --throttling.cpuSlowdownMultiplier=2"
DESKTOP_LIGHTHOUSE_PARAMS: "--only-categories=performance,accessibility,best-practices,seo --preset=desktop --throttling.cpuSlowdownMultiplier=1"
# TRIGGERS
on:
page_build:
# schedule: # Check your schedule here => https://crontab.guru/
# - cron: '55 23 * * 0' # e.g. every Sunday at 23:55
#
# THAT'S IT; YOU'RE DONE;
workflow_dispatch:
########################################################################
# THAT'S IT; YOU DON'T HAVE TO DEFINE ANYTHING IN THE FOLLOWING
########################################################################
jobs:
lighthouse-badger-easy:
runs-on: ubuntu-latest
timeout-minutes: 8
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: ${{ env.REPO_BRANCH }}
- uses: actions/checkout@v4
with:
repository: ${{ env.REPOSITORY }}
token: ${{ secrets[github.event.inputs.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: ${{ env.URLS }}
mobile_lighthouse_params: ${{ env.MOBILE_LIGHTHOUSE_PARAMS }}
desktop_lighthouse_params: ${{ env.DESKTOP_LIGHTHOUSE_PARAMS }}