mirror of
https://github.com/bartvdbraak/hellob.art.git
synced 2025-04-26 00:51:20 +00:00
refactor: run lighthouse accurate on vercel target
This commit is contained in:
parent
6b31e60617
commit
2a4f0207c5
2 changed files with 23 additions and 8 deletions
23
.github/workflows/unlighthouse.yaml
vendored
23
.github/workflows/unlighthouse.yaml
vendored
|
@ -34,14 +34,21 @@ jobs:
|
|||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm install
|
||||
- name: Retrieve Vercel Preview URL
|
||||
uses: zentered/vercel-preview-url@v1.1.9
|
||||
id: vercel_preview_url
|
||||
env:
|
||||
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
|
||||
with:
|
||||
vercel_project_id: ${{ vars.VERCEL_PROJECT_ID }}
|
||||
|
||||
- name: Build production
|
||||
run: npm run build
|
||||
|
||||
- name: Start Preview and Get Preview URL
|
||||
run: npm run preview -- --port=${{ env.PORT }} & echo $! > preview_pid
|
||||
- name: Await Vercel Deployment
|
||||
uses: UnlyEd/github-action-await-vercel@v1.2.43
|
||||
env:
|
||||
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
|
||||
with:
|
||||
deployment-url: ${{ steps.vercel_preview_url.outputs.preview_url }}
|
||||
timeout: 120
|
||||
|
||||
- name: Install Dependencies
|
||||
run: npm add -g @unlighthouse/cli puppeteer
|
||||
|
@ -49,7 +56,7 @@ jobs:
|
|||
- name: Run Unlighthouse
|
||||
run: |
|
||||
unlighthouse-ci \
|
||||
--site "http://localhost:${{ env.PORT }}" \
|
||||
--site "${{ steps.vercel_preview_url.outputs.preview_url }}" \
|
||||
--reporter jsonExpanded \
|
||||
--build-static
|
||||
|
||||
|
|
8
unlighthouse.config.ts
Normal file
8
unlighthouse.config.ts
Normal file
|
@ -0,0 +1,8 @@
|
|||
export default {
|
||||
scanner: {
|
||||
samples: 3
|
||||
},
|
||||
puppeteerClusterOptions: {
|
||||
maxConcurrency: 1
|
||||
}
|
||||
};
|
Loading…
Reference in a new issue