mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-10-27 07:25:48 -04:00
trigger lighthouse audits on Netlify deploy previews
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, pull_request]
|
||||
|
||||
jobs:
|
||||
lighthouse:
|
||||
runs-on: ubuntu-latest
|
||||
if: "!contains(github.event.head_commit.message, '[skip ci]')"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 12.x
|
||||
- name: Install utilities
|
||||
run: npm install -g netlify-cli @lhci/cli
|
||||
- name: Wait for Netlify
|
||||
run: netlify watch
|
||||
env:
|
||||
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
|
||||
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
||||
- name: Audit deploy preview
|
||||
if: github.event_name == 'pull_request'
|
||||
continue-on-error: true
|
||||
run: |
|
||||
lhci autorun --config=./lighthouserc.json \
|
||||
--collect.url=https://deploy-preview-${{ github.event.number }}--jakejarvis.netlify.com/ \
|
||||
--collect.url=https://deploy-preview-${{ github.event.number }}--jakejarvis.netlify.com/notes/ \
|
||||
--collect.url=https://deploy-preview-${{ github.event.number }}--jakejarvis.netlify.com/notes/how-to-pull-request-fork-github/ \
|
||||
--collect.url=https://deploy-preview-${{ github.event.number }}--jakejarvis.netlify.com/notes/how-to-pull-request-fork-github/amp.html
|
||||
env:
|
||||
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
|
||||
- name: Audit jarv.is
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
||||
continue-on-error: true
|
||||
run: |
|
||||
lhci autorun --config=./lighthouserc.json \
|
||||
--collect.url=https://jarv.is/ \
|
||||
--collect.url=https://jarv.is/notes/ \
|
||||
--collect.url=https://jarv.is/notes/how-to-pull-request-fork-github/ \
|
||||
--collect.url=https://jarv.is/notes/how-to-pull-request-fork-github/amp.html
|
||||
env:
|
||||
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
|
||||
Reference in New Issue
Block a user