Skip to content

feat: add Lighthouse CI workflow #2

feat: add Lighthouse CI workflow

feat: add Lighthouse CI workflow #2

Workflow file for this run

name: Lighthouse Performance Test
on:
push:
branches:
- feat/lighthouse
pull_request:
branches:
- feat/lighthouse
jobs:
lighthouse:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Install Lighthouse
run: npm install -g lighthouse
- name: Start local server
run: |
# Adjust this command to start your local server
npm install
npm start &
sleep 15
- name: Run Lighthouse on local site
id: lighthouse-local
run: lighthouse http://localhost:3000 --output html --output-path ./lighthouse-local.html --output json --output-path ./lighthouse-local.json
- name: Display local Lighthouse report
run: cat ./lighthouse-local.json | jq
- name: Upload Lighthouse results
uses: actions/upload-artifact@v2
with:
name: lighthouse-results
path: |
lighthouse-local.html
lighthouse-local.json