Skip to content

Commit

Permalink
Merge pull request #410 from mazipan/mazipan/fix-netlify-preview-erro…
Browse files Browse the repository at this point in the history
…r-on-main

fix(ci): netlify preview action error on main
  • Loading branch information
zainfathoni authored Jul 25, 2021
2 parents e53993b + 455402e commit cf1637d
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 4 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/lighthouse-ci-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Web Perf Check

on:
push:
branches: [main]

jobs:
lhci:
name: Run Lighthouse CI on Production
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v1
with:
node-version: "14"

- name: "Lighthouse CI assertion"
id: lhci
shell: bash
run: |
yarn global add @lhci/[email protected]
echo -e "\n"
echo "Start collecting LH report..."
lhci collect --url=https://www.wargabantuwarga.com/ -n=1
echo -e "\n"
echo "Start asserting LH score..."
lhci assert --config=./lighthouserc.js
echo -e "\n"
echo "Start uploading the report..."
lhci upload --target "temporary-public-storage" --githubAppToken "$LHCI_GITHUB_APP_TOKEN" --githubToken "$GITHUB_TOKEN"
env:
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 2 additions & 4 deletions .github/workflows/lighthouse-ci.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
name: Lighthouse CI
name: Web Perf Check for Pull Request

on:
push:
branches: [main]
pull_request:
types: [labeled]

jobs:
lhci:
name: Run Lighthouse CI
name: Run Lighthouse CI for Pull Request
runs-on: ubuntu-latest

if: ${{ !contains(github.event.pull_request.labels.*.names, 'need-perf-check') }}
Expand Down

0 comments on commit cf1637d

Please sign in to comment.