1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-10-28 21:55:48 -04:00

fix CI skip condition for bot PRs

[skip ci]
This commit is contained in:
2020-04-30 10:57:35 -04:00
parent dead391723
commit c8265db6cc
5 changed files with 22 additions and 26 deletions

View File

@@ -9,7 +9,9 @@ on:
jobs: jobs:
deploy: deploy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: (!contains(github.event.head_commit.message, '[skip ci]')) # "[skip ci]" also causes Netlify to skip, so these are automatically in harmony
# https://docs.netlify.com/site-deploys/manage-deploys/#skip-a-deploy
if: "!contains(github.event.head_commit.message, '[skip ci]')"
env: env:
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
@@ -19,7 +21,6 @@ jobs:
lighthouse: lighthouse:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: (!contains(github.event.head_commit.message, '[skip ci]'))
needs: deploy needs: deploy
env: env:
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }} LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
@@ -27,7 +28,7 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: actions/setup-node@v1 - uses: actions/setup-node@v1
with: with:
node-version: '12.x' node-version: 12.x
- name: Install LHCI - name: Install LHCI
run: npm install -g @lhci/cli run: npm install -g @lhci/cli
- name: Audit deploy preview - name: Audit deploy preview
@@ -50,11 +51,11 @@ jobs:
uses: actions/upload-artifact@v1 uses: actions/upload-artifact@v1
with: with:
name: lhci-results name: lhci-results
path: './.lighthouseci' path: ./.lighthouseci
build: percy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: (!contains(github.actor, '[bot]')) || (!contains(github.event.head_commit.message, '[skip ci]')) if: "!contains(github.actor, '[bot]') && !contains(github.event.head_commit.message, '[skip ci]')"
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with: with:
@@ -62,10 +63,10 @@ jobs:
lfs: false lfs: false
- uses: actions/setup-node@v1 - uses: actions/setup-node@v1
with: with:
node-version: '12.x' node-version: 12.x
- uses: actions/setup-go@v2-beta - uses: actions/setup-go@v2-beta
with: with:
go-version: '1.14.x' go-version: 1.14.x
# https://github.com/actions/cache/blob/master/examples.md#node---yarn # https://github.com/actions/cache/blob/master/examples.md#node---yarn
# https://github.com/actions/cache/issues/60 # https://github.com/actions/cache/issues/60
- name: Get yarn cache location - name: Get yarn cache location
@@ -78,13 +79,13 @@ jobs:
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: | restore-keys: |
${{ runner.os }}-yarn- ${{ runner.os }}-yarn-
- name: Install - name: Install deps
run: yarn install --no-ignore-optional --frozen-lockfile run: yarn install --no-ignore-optional --frozen-lockfile
- name: Build preview - name: Build site preview
run: yarn build:preview run: yarn build:preview
- name: Lint - name: Lint
run: yarn lint
continue-on-error: true continue-on-error: true
run: yarn lint
- name: Percy snapshots - name: Percy snapshots
uses: percy/snapshot-action@v0.1.0 uses: percy/snapshot-action@v0.1.0
env: env:

View File

@@ -10,6 +10,7 @@
"frame-title": "warn", "frame-title": "warn",
"link-text": "warn", "link-text": "warn",
"total-byte-weight": ["warn", {"minScore": 0.9}], "total-byte-weight": ["warn", {"minScore": 0.9}],
"unminified-javascript": "warn",
"unused-css-rules": "warn", "unused-css-rules": "warn",
"uses-rel-preconnect": "warn", "uses-rel-preconnect": "warn",
"is-crawlable": "off", "is-crawlable": "off",

View File

@@ -3,15 +3,9 @@ snapshot:
widths: [450, 1050] # px widths: [450, 1050] # px
enable-javascript: true enable-javascript: true
percy-css: | percy-css: |
div.embed { div.embed, iframe, video {
display: none; display: none;
} }
video {
display: none;
}
iframe#sa-graph {
display: none; /* analytics graph will change every time, obviously */
}
code, div.highlight { code, div.highlight {
border: 0 !important; /* no clue why this bugs out... */ border: 0 !important; /* no clue why this bugs out... */
} }

View File

@@ -19,7 +19,6 @@
var loc = window.location; var loc = window.location;
var doc = window.document; var doc = window.document;
var notSending = "Not sending requests "; var notSending = "Not sending requests ";
var localhost = "localhost";
var encodeURIComponentFunc = encodeURIComponent; var encodeURIComponentFunc = encodeURIComponent;
var decodeURIComponentFunc = decodeURIComponent; var decodeURIComponentFunc = decodeURIComponent;
var stringify = JSON.stringify; var stringify = JSON.stringify;
@@ -27,11 +26,15 @@
var addEventListenerFunc = window.addEventListener; var addEventListenerFunc = window.addEventListener;
var fullApiUrl = protocol + baseUrl; var fullApiUrl = protocol + baseUrl;
var undefinedVar = undefined; var undefinedVar = undefined;
var hostname = loc.hostname;
var functionName = "sa_event";
var payload = { var payload = {
version: 2 version: 2
}; };
payload.hostname = hostname;
// A simple log function so the user knows why a request is not being send // A simple log function so the user knows why a request is not being send
var warn = function(message) { var warn = function(message) {
if (con && con.warn) con.warn("Simple Analytics:", message); if (con && con.warn) con.warn("Simple Analytics:", message);
@@ -133,15 +136,10 @@
var scrolled = 0; var scrolled = 0;
/** endif **/ /** endif **/
var hostname = loc.hostname;
var functionName = "sa_event";
payload.hostname = hostname;
// Don't track when localhost // Don't track when localhost
/** unless testing **/ /** unless testing **/
if (loc.hostname.indexOf(".") == -1) if (loc.hostname.indexOf(".") == -1)
return warn(notSending + "from " + loc.localhost); return warn(notSending + "from localhost");
/** endunless **/ /** endunless **/
try { try {

View File

@@ -9,4 +9,6 @@
{{ partialCached "head/webmention" . -}} {{ partialCached "head/webmention" . -}}
{{ partial "head/canonical" . -}} {{ partial "head/canonical" . -}}
{{ partial "head/schema" . -}} {{ partial "head/schema" . -}}
{{ partial "scripts/simple_analytics_events" . -}} {{ if eq hugo.Environment "production" }}
{{ partial "scripts/simple_analytics_events" . -}}
{{ end }}