-
-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (74 loc) · 2.94 KB
/
scan.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
73
74
75
76
77
78
79
80
81
82
name: scan.lighthouse
on:
workflow_dispatch:
push:
branches: [$default-branch, gh-pages]
pull_request:
branches: [$default-branch, gh-pages]
types: [opened,assigned,synchronize]
schedule:
- cron: '0 10 * * 2'
env:
ENDPOIND: https://ivankatliarchuk.github.io/knowledge-base
TEMPLATE: .github/templates/issue.lighthouse.md
jobs:
lighthouse:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1
with:
fetch-depth: 1
- name: run lighthouse
uses: foo-software/lighthouse-check-action@master
id: lighthouseCheck
with:
accessToken: ${{ secrets.GITHUB_TOKEN }}
tag: GitHub Action
urls: ${{ env.ENDPOIND }}
sha: ${{ github.sha }}
branch: ${{ github.ref }}
author: ${{ github.actor }}
prCommentEnabled: true
prCommentSaveOld: true
outputDirectory: "_help"
# - name: Upload artifacts
# uses: actions/upload-artifact@master
# with:
# name: Lighthouse reports
# path: _help
- name: handle lighthouse check results
uses: foo-software/lighthouse-check-status-action@master
id: status
with:
lighthouseCheckResults: ${{ steps.lighthouseCheck.outputs.lighthouseCheckResults }}
minAccessibilityScore: "90"
minBestPracticesScore: "50"
minPerformanceScore: "50"
minProgressiveWebAppScore: "50"
minSeoScore: "50"
- name: results
id: results
run: |
echo "::set-output name=accessibility::$(cat _help/results.json | jq '.[] | .scores.accessibility')"
echo "::set-output name=bestPractices::$(cat _help/results.json | jq '.[] | .scores.bestPractices')"
echo "::set-output name=performance::$(cat _help/results.json | jq '.[] | .scores.performance')"
echo "::set-output name=progressiveWebApp::$(cat _help/results.json | jq '.[] | .scores.progressiveWebApp')"
echo "::set-output name=seo::$(cat _help/results.json | jq '.[] | .scores.seo')"
# https://github.com/JasonEtco/actions-toolkit#toolscontext
- name: create issue from file
uses: JasonEtco/create-an-issue@v2.9.1
id: create-issue
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ACCESSIBILITY: ${{ steps.results.outputs.accessibility }}
BEST_PRACTICES: ${{ steps.results.outputs.bestPractices }}
PERFORMANCE: ${{ steps.results.outputs.performance }}
PROGRESSIVE_WEBAPP: ${{ steps.results.outputs.progressiveWebApp }}
SEO: ${{ steps.results.outputs.seo }}
TITLE: 'Lighthosue performance'
with:
filename: ${{ env.TEMPLATE }}
assignees: ${{ github.repository_owner }}
update_existing: true
- run: 'echo Created issue number ${{ steps.create-issue.outputs.number }}'
- run: 'echo Created ${{ steps.create-issue.outputs.url }}'