mirror of
https://github.com/BBaoVanC/bbaovanc.com.git
synced 2025-07-03 10:37:29 -05:00
Merge pull request #24 from BBaoVanC/lighthouse-actions
Add Lighthouse job to `audit` workflow
This commit is contained in:
39
.github/workflows/audit.yml
vendored
39
.github/workflows/audit.yml
vendored
@ -4,6 +4,45 @@ on:
|
||||
push:
|
||||
|
||||
jobs:
|
||||
lighthouse:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkount
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
fetch-depth: 0
|
||||
ref: ${{github.event.pull_request.head.ref}}
|
||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
||||
|
||||
- name: Install Caddy
|
||||
run: |
|
||||
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo tee /etc/apt/trusted.gpg.d/caddy-stable.asc
|
||||
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
|
||||
sudo apt update
|
||||
sudo apt install caddy
|
||||
sudo systemctl disable --now caddy
|
||||
|
||||
- name: Setup Hugo
|
||||
uses: peaceiris/actions-hugo@v2
|
||||
with:
|
||||
hugo-version: latest
|
||||
extended: true
|
||||
|
||||
- name: Build
|
||||
run: hugo --printI18nWarnings --printPathWarnings --baseURL https://localhost
|
||||
|
||||
- name: Compress
|
||||
run: time ./compress.sh
|
||||
|
||||
- name: Audit using Lighthouse
|
||||
uses: treosh/lighthouse-ci-action@v9
|
||||
with:
|
||||
uploadArtifacts: true
|
||||
temporaryPublicStorage: true
|
||||
configPath: ./lighthouserc.yaml
|
||||
|
||||
|
||||
audit:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
9
Caddyfile
Normal file
9
Caddyfile
Normal file
@ -0,0 +1,9 @@
|
||||
# vim: ft=caddyfile
|
||||
|
||||
https://localhost {
|
||||
header Cache-Control no-cache
|
||||
root * public/
|
||||
file_server {
|
||||
precompressed br gzip
|
||||
}
|
||||
}
|
10
lighthouserc.yaml
Normal file
10
lighthouserc.yaml
Normal file
@ -0,0 +1,10 @@
|
||||
ci:
|
||||
collect:
|
||||
url:
|
||||
- https://localhost/
|
||||
- https://localhost/blog/
|
||||
- https://localhost/blog/caddy-is-the-best-webserver/
|
||||
- https://localhost/links/
|
||||
startServerCommand: sudo caddy run
|
||||
settings:
|
||||
chromeFlags: "--ignore-certificate-errors --throttling.cpuSlowdownMultiplier=2.4"
|
Reference in New Issue
Block a user