forked from kawalcovid19/wargabantuwarga.com
-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (36 loc) · 1.22 KB
/
lighthouse-ci.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
name: Web Perf Check for Pull Request
on:
pull_request:
types: [labeled]
jobs:
lhci:
name: Run Lighthouse CI for Pull Request
runs-on: ubuntu-latest
if: ${{ github.event.label.name == 'need-perf-check' }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: "14"
- name: Wait for the Netlify Preview
uses: jakepartusch/wait-for-netlify-action@v1
id: netlify
with:
site_name: 'wargabantuwarga'
- name: "Lighthouse CI assertion"
id: lhci
shell: bash
run: |
yarn global add @lhci/[email protected]
echo -e "\n"
echo "Start collecting LH report..."
lhci collect --url=${{ steps.netlify.outputs.url }} -n=1
echo -e "\n"
echo "Start asserting LH score..."
lhci assert --config=./lighthouserc.js
echo -e "\n"
echo "Start uploading the report..."
lhci upload --target "temporary-public-storage" --githubAppToken "$LHCI_GITHUB_APP_TOKEN" --githubToken "$GITHUB_TOKEN"
env:
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}