mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-10-27 05:25:48 -04:00
re-add Percy screenshotting action
This commit is contained in:
42
.github/workflows/ci.yml
vendored
Normal file
42
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: "!contains(github.event.head_commit.message, '[skip ci]')"
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 1
|
||||||
|
- uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: 14.x
|
||||||
|
- name: Install dependencies
|
||||||
|
run: yarn install --frozen-lockfile
|
||||||
|
- name: Run linters
|
||||||
|
run: yarn lint
|
||||||
|
|
||||||
|
snapshot:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: "!contains(github.event.head_commit.message, '[skip ci]')"
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 1
|
||||||
|
- uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: 14.x
|
||||||
|
- name: Install dependencies
|
||||||
|
run: yarn install --frozen-lockfile
|
||||||
|
- name: Build preview
|
||||||
|
run: yarn build:hugo --environment=development --baseURL=/ --buildDrafts --buildFuture
|
||||||
|
- name: Percy snapshots
|
||||||
|
uses: percy/snapshot-action@v0.1.2
|
||||||
|
env:
|
||||||
|
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
{
|
|
||||||
"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"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
11
.percy.yml
11
.percy.yml
@@ -14,13 +14,16 @@ snapshot:
|
|||||||
div.highlight {
|
div.highlight {
|
||||||
border: 0 !important; /* no clue why this bugs out... */
|
border: 0 !important; /* no clue why this bugs out... */
|
||||||
}
|
}
|
||||||
.wave,
|
*,
|
||||||
.beat {
|
::before,
|
||||||
animation: none;
|
::after {
|
||||||
|
animation: none !important;
|
||||||
|
transition-duration: 0s !important;
|
||||||
|
transition-delay: 0s !important;
|
||||||
}
|
}
|
||||||
static-snapshots:
|
static-snapshots:
|
||||||
path: public/
|
path: public/
|
||||||
snapshot-files: 'index.html,uses/index.html,notes/{netlify-analytics-review,shodan-search-queries,dropping-dropbox,coronavirus-open-source}/index.html'
|
snapshot-files: 'index.html,uses/index.html,notes/{how-to-pull-request-fork-github,shodan-search-queries}/index.html'
|
||||||
agent:
|
agent:
|
||||||
asset-discovery:
|
asset-discovery:
|
||||||
network-idle-timeout: 2000 # ms
|
network-idle-timeout: 2000 # ms
|
||||||
|
|||||||
@@ -81,8 +81,8 @@ module.exports = async (req, res) => {
|
|||||||
|
|
||||||
const repos = await fetchRepos(sortBy, 16);
|
const repos = await fetchRepos(sortBy, 16);
|
||||||
|
|
||||||
// let Vercel edge cache results for 10 mins
|
// let Vercel edge cache results for 15 mins
|
||||||
res.setHeader("Cache-Control", "s-maxage=600, stale-while-revalidate");
|
res.setHeader("Cache-Control", "s-maxage=900, stale-while-revalidate");
|
||||||
res.setHeader("Access-Control-Allow-Methods", "GET");
|
res.setHeader("Access-Control-Allow-Methods", "GET");
|
||||||
res.setHeader("Access-Control-Allow-Origin", "*");
|
res.setHeader("Access-Control-Allow-Origin", "*");
|
||||||
return res.json(repos);
|
return res.json(repos);
|
||||||
|
|||||||
@@ -73,6 +73,8 @@ module.exports = async (req, res) => {
|
|||||||
stats.total.pretty_hits = numeral(stats.total.hits).format("0,0");
|
stats.total.pretty_hits = numeral(stats.total.hits).format("0,0");
|
||||||
stats.total.pretty_unit = pluralize("hit", stats.total.hits);
|
stats.total.pretty_unit = pluralize("hit", stats.total.hits);
|
||||||
|
|
||||||
|
// let Vercel edge cache results for 15 mins
|
||||||
|
res.setHeader("Cache-Control", "s-maxage=900, stale-while-revalidate");
|
||||||
res.setHeader("Access-Control-Allow-Methods", "GET");
|
res.setHeader("Access-Control-Allow-Methods", "GET");
|
||||||
res.setHeader("Access-Control-Allow-Origin", "*");
|
res.setHeader("Access-Control-Allow-Origin", "*");
|
||||||
return res.json(stats);
|
return res.json(stats);
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ disableHugoGeneratorInject = true
|
|||||||
description = "Hi there! I'm a frontend web developer based in Boston, Massachusetts specializing in the JAMstack, modern JavaScript frameworks, and progressive web apps."
|
description = "Hi there! I'm a frontend web developer based in Boston, Massachusetts specializing in the JAMstack, modern JavaScript frameworks, and progressive web apps."
|
||||||
image = "img/logo.png" # relative to assetDir root
|
image = "img/logo.png" # relative to assetDir root
|
||||||
mainSection = "notes" # content that appears in feeds
|
mainSection = "notes" # content that appears in feeds
|
||||||
baseOnionURL = "http://jarvis2i2vp4j4tbxjogsnqdemnte5xhzyi7hziiyzxwge3hzmh57zad.onion"
|
|
||||||
[params.theme]
|
[params.theme]
|
||||||
maxWidth = 865 # px
|
maxWidth = 865 # px
|
||||||
defaultTheme = "light" # light or dark?
|
defaultTheme = "light" # light or dark?
|
||||||
|
|||||||
@@ -29,9 +29,10 @@
|
|||||||
|
|
||||||
# TECHNOLOGY
|
# TECHNOLOGY
|
||||||
|
|
||||||
Hugo
|
Hugo extended
|
||||||
Vercel
|
Vercel
|
||||||
...and much more: https://jarv.is/uses/
|
FaunaDB
|
||||||
|
...and more: https://jarv.is/uses/
|
||||||
|
|
||||||
# VIEW SOURCE
|
# VIEW SOURCE
|
||||||
|
|
||||||
|
|||||||
@@ -1,28 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "jarv.is",
|
|
||||||
"image": "mcr.microsoft.com/vscode/devcontainers/javascript-node:0-14",
|
|
||||||
"settings": {
|
|
||||||
"editor.fontFamily": "'Source Code Pro', Menlo, Monaco, 'Courier New', monospace",
|
|
||||||
"editor.fontSize": 14,
|
|
||||||
"editor.letterSpacing": 0.2,
|
|
||||||
"editor.lineHeight": 23,
|
|
||||||
"editor.minimap.enabled": false,
|
|
||||||
"terminal.integrated.shell.linux": "/bin/zsh",
|
|
||||||
"workbench.colorTheme": "GitHub Dark"
|
|
||||||
},
|
|
||||||
"extensions": [
|
|
||||||
"budparr.language-hugo-vscode",
|
|
||||||
"bungcip.better-toml",
|
|
||||||
"dbaeumer.vscode-eslint",
|
|
||||||
"esbenp.prettier-vscode",
|
|
||||||
"stylelint.vscode-stylelint"
|
|
||||||
],
|
|
||||||
"forwardPorts": [
|
|
||||||
1337,
|
|
||||||
9337
|
|
||||||
],
|
|
||||||
"postCreateCommand": "yarn install",
|
|
||||||
"containerEnv": {
|
|
||||||
"DISABLE_NODEJS_BUILD": "true"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
"headers": [
|
"headers": [
|
||||||
{
|
{
|
||||||
"key": "Cache-Control",
|
"key": "Cache-Control",
|
||||||
"value": "public, max-age=2628000"
|
"value": "public, max-age=2628000, immutable"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user