Skip to content

Commit dc24d84

Browse files
committed
1 parent 325959f commit dc24d84

File tree

3 files changed

+270
-219
lines changed

3 files changed

+270
-219
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ jobs:
1111
runs-on: ubuntu-latest
1212
# "[skip ci]" also causes Netlify to skip, so these are automatically in harmony
1313
# https://docs.netlify.com/site-deploys/manage-deploys/#skip-a-deploy
14-
if: "!contains(github.event.head_commit.message, '[skip ci]')"
14+
if: "github.actor == 'jakejarvis' && !contains(github.event.head_commit.message, '[skip ci]')"
1515
timeout-minutes: 20
16-
env:
17-
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
18-
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
1916
steps:
2017
- name: Wait for Netlify
2118
# installing via `npx` each run takes a long time, but deploys always take longer
2219
run: npx netlify-cli watch
20+
env:
21+
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
22+
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
2323

2424
audit:
2525
runs-on: ubuntu-latest
@@ -63,43 +63,3 @@ jobs:
6363
with:
6464
name: lhci-results
6565
path: ./.lighthouseci
66-
67-
lint:
68-
runs-on: ubuntu-latest
69-
if: "!contains(github.event.head_commit.message, '[skip ci]')"
70-
steps:
71-
- uses: actions/checkout@v2
72-
with:
73-
fetch-depth: 1
74-
lfs: false
75-
- uses: actions/setup-node@v2
76-
with:
77-
node-version: 14.x
78-
- name: Get Yarn cache path
79-
# https://github.com/actions/cache/blob/master/examples.md#node---yarn
80-
# https://github.com/actions/cache/issues/60
81-
id: yarn-cache
82-
run: echo "::set-output name=dir::$(yarn cache dir)"
83-
- name: Cache dependencies
84-
uses: actions/cache@v2
85-
with:
86-
path: ${{ steps.yarn-cache.outputs.dir }}
87-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
88-
restore-keys: |
89-
${{ runner.os }}-yarn-
90-
- name: Install dependencies
91-
run: yarn install --no-ignore-optional --frozen-lockfile
92-
- name: Audit dependencies
93-
run: yarn audit || true
94-
continue-on-error: true
95-
- name: Lint
96-
run: yarn lint
97-
continue-on-error: true
98-
- name: Build
99-
run: yarn build:hugo --environment development --baseURL / --buildDrafts --buildFuture
100-
- name: Percy snapshots
101-
# uncomment to disable all bot PRs (eg. dependabot) -- I'm using the free plan...
102-
# if: "!contains(github.actor, '[bot]')"
103-
uses: percy/[email protected]
104-
env:
105-
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}

.github/workflows/lint.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Lint
2+
3+
# this step was separated out from ci.yml because of changes to how secrets are handled:
4+
# https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
pull_request:
11+
12+
jobs:
13+
lint:
14+
runs-on: ubuntu-latest
15+
if: "!contains(github.event.head_commit.message, '[skip ci]')"
16+
steps:
17+
- uses: actions/checkout@v2
18+
with:
19+
fetch-depth: 1
20+
lfs: false
21+
- uses: actions/setup-node@v2
22+
with:
23+
node-version: 14.x
24+
- name: Get Yarn cache path
25+
# https://github.com/actions/cache/blob/master/examples.md#node---yarn
26+
# https://github.com/actions/cache/issues/60
27+
id: yarn-cache
28+
run: echo "::set-output name=dir::$(yarn cache dir)"
29+
- name: Cache dependencies
30+
uses: actions/cache@v2
31+
with:
32+
path: ${{ steps.yarn-cache.outputs.dir }}
33+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
34+
restore-keys: |
35+
${{ runner.os }}-yarn-
36+
- name: Install dependencies
37+
run: yarn install --no-ignore-optional --frozen-lockfile
38+
- name: Audit dependencies
39+
run: yarn audit || true
40+
continue-on-error: true
41+
- name: Build preview
42+
run: yarn build:hugo --environment development --baseURL / --buildDrafts --buildFuture
43+
- name: Lint
44+
run: yarn lint
45+
- name: Percy snapshots
46+
uses: percy/[email protected]
47+
env:
48+
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}

0 commit comments

Comments
 (0)