Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 57 additions & 2 deletions .github/workflows/vrt.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,33 @@
on: [push]
name: CI

on: [push, pull_request]

permissions:
contents: read
statuses: write

jobs:
build:
test:
runs-on: ubuntu-latest
name: Test

steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup Node
uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'

- name: Install dependencies
run: npm install

- name: Test
run: npm test

visual-regression:
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
if: github.event_name == 'pull_request' || github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
name: Lost Pixel

Expand All @@ -27,3 +53,32 @@ jobs:
uses: lost-pixel/lost-pixel@v3.22.0
env:
LOST_PIXEL_API_KEY: ${{ secrets.LOST_PIXEL_API_KEY }}

deploy-production:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
name: Deploy production
needs: [test, visual-regression]

steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup Node
uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'

- name: Install dependencies
run: npm install

- name: Build app
run: npm run build

- name: Deploy to Netlify
run: >
npx --yes netlify-cli deploy --prod --dir=dist --site
"$NETLIFY_SITE_ID" --auth "$NETLIFY_AUTH_TOKEN"
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@ Source for [johnkurkowski.com](https://johnkurkowski.com).

npm test

Tests are run in CI and must pass prior to deployment.
Tests are run in CI and must pass before production deploy, i.e. pushes to
trunk. Branches deploy regardless of CI passing.

[Lost Pixel](https://app.lost-pixel.com/) visual regression review is run during
CI, but does not block deployment. If there are visual differences in your
build, they require manual, asynchronous review. Before push, you can preview
Lost Pixel's snapshots against your running local server in production mode.
Before push, you can preview [Lost Pixel](https://app.lost-pixel.com/) VRT's
snapshots against your running local server in production mode.

npm run build
npm run serve &
npm run preview &
npx lost-pixel local
3 changes: 2 additions & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[build]
command = "npm test && npm run build"
command = "npm run build"
ignore = "[ \"$CONTEXT\" = \"production\" ]"
publish = "dist/"