1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-04-26 14:28:25 -04:00

re-add LHCI workflow with vercel deployment URLs

This commit is contained in:
Jake Jarvis 2021-06-11 13:01:17 -04:00
parent 74d2ff49ff
commit 57ceac6a9e
Signed by: jake
GPG Key ID: 2B0C9CF251E69A39
3 changed files with 79 additions and 0 deletions

44
.github/workflows/lighthouse.yml vendored Normal file
View File

@ -0,0 +1,44 @@
name: Lighthouse
on:
deployment_status
jobs:
audit:
runs-on: ubuntu-latest
if: github.event.deployment_status.state == 'success'
env:
LHCI_TOKEN: ${{ secrets.LHCI_TOKEN }}
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
LHCI_SERVER_BASE_URL: https://lhci.jrvs.io
LHCI_BUILD_CONTEXT__CURRENT_BRANCH: ${{ github.event.deployment.ref }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
lfs: false
- uses: actions/setup-node@v2
with:
node-version: 14.x
- run: npm install -g @lhci/cli
- run: |
lhci --version
lhci healthcheck
curl $LHCI_SERVER_BASE_URL/version
echo ${{ github.event.deployment_status.target_url }}
- if: github.event.deployment_status.environment == 'production'
continue-on-error: true
run: |
lhci autorun \
--collect.url=https://jarv.is/ \
--collect.url=https://jarv.is/notes/how-to-pull-request-fork-github/
- if: github.event.deployment_status.environment == 'preview'
continue-on-error: true
run: |
lhci autorun \
--collect.url=${{ github.event.deployment_status.target_url }}/ \
--collect.url=${{ github.event.deployment_status.target_url }}/notes/how-to-pull-request-fork-github/
- uses: actions/upload-artifact@v2
with:
name: lhci-results
path: ./.lighthouseci

34
.lighthouserc.json Normal file
View File

@ -0,0 +1,34 @@
{
"ci": {
"collect": {
"numberOfRuns": 3
},
"assert": {
"preset": "lighthouse:no-pwa",
"assertions": {
"color-contrast": "warn",
"errors-in-console": "warn",
"inspector-issues": "warn",
"link-text": "warn",
"long-tasks": "warn",
"non-composited-animations": "warn",
"total-byte-weight": ["warn", {"minScore": 0.9}],
"unminified-javascript": "warn",
"unsized-images": "warn",
"unused-css-rules": "warn",
"unused-javascript": "warn",
"uses-optimized-images": "warn",
"uses-rel-preconnect": "warn",
"is-crawlable": "off",
"offscreen-images": "off",
"uses-long-cache-ttl": "off",
"uses-responsive-images": "off",
"uses-webp-images": "off"
}
},
"upload": {
"target": "lhci",
"serverBaseUrl": "https://lhci.jrvs.io"
}
}
}

View File

@ -1,6 +1,7 @@
# 🏡  [jarv.is](https://jarv.is/)
[![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/jakejarvis/jarv.is/CI/main?label=build&logo=github&logoColor=white)](https://github.com/jakejarvis/jarv.is/actions?query=workflow%3ACI+branch%3Amain)
[![Vercel deployment](https://img.shields.io/github/deployments/jakejarvis/jarv.is/production?label=vercel&logo=vercel&logoColor=white)](https://vercel.com/deployments/jarv.is)
[![Hugo v0.83.1](https://img.shields.io/badge/hugo-0.83.1-ff4088?logo=hugo&logoColor=white)](https://github.com/gohugoio/hugo)
[![Licensed under CC-BY-4.0](https://img.shields.io/badge/license-CC--BY--4.0-fb7828?logo=creative-commons&logoColor=white)](LICENSE.md)
[![GitHub repo size](https://img.shields.io/github/repo-size/jakejarvis/jarv.is?color=009cdf&label=repo%20size&logo=git&logoColor=white)](https://github.com/jakejarvis/jarv.is)