-
Notifications
You must be signed in to change notification settings - Fork 12
47 lines (40 loc) · 1.35 KB
/
web-vitals-init.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
name: Initialize Web Vitals Baseline
on:
workflow_dispatch:
inputs:
initialize:
description: 'Initialize baseline'
required: true
type: boolean
default: false
jobs:
initialize-web-vitals:
if: inputs.initialize == true
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16.13.1
cache: 'npm'
- name: Install dependencies
run: |
npm ci
npm install puppeteer web-vitals
- name: Install Chrome dependencies
run: |
sudo apt-get update
sudo apt-get install -y xvfb libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 libxkbcommon0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 libgbm1 libasound2
- name: Initialize Baseline
run: |
xvfb-run --auto-servernum --server-args="-screen 0 1920x1080x24" node ./web-vitals-check.js https://adobecom.github.io/caas/ --init-baseline
- name: Commit baseline
run: |
git config --global user.name 'GitHub Action'
git config --global user.email '[email protected]'
git add .github/web-vitals-history.json
git commit -m "chore: update web vitals baseline"
git push