From 68ff6043e1d68de44ff1cf3790ccfc1d9c49d595 Mon Sep 17 00:00:00 2001 From: hanyugeon Date: Wed, 29 May 2024 15:20:52 +0900 Subject: [PATCH] =?UTF-8?q?setting:=20LightHouse=20CI=20=ED=8C=8C=EC=9D=BC?= =?UTF-8?q?=20=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/lighthouse.yml | 30 ++++++++++++++++++++++++++++++ lighthouserc.js | 13 +++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 .github/workflows/lighthouse.yml create mode 100644 lighthouserc.js diff --git a/.github/workflows/lighthouse.yml b/.github/workflows/lighthouse.yml new file mode 100644 index 00000000..02bfa80e --- /dev/null +++ b/.github/workflows/lighthouse.yml @@ -0,0 +1,30 @@ +name: lighthouse CI + +on: + pull_request: + branches: [push] + +jobs: + lhci: + name: Lighthouse CI + runs-on: ubuntu-latest + steps: + - name: Checkout + - uses: actions/checkout@v2 + + - name: Use Node.js 18 + uses: actions/setup-node@v1 + with: + node-version: 18 + cache: 'yarn' + + - name: Install packages + run: yarn install && yarn global add @lhci/cli + + - name: Build + run: yarn build + + - name: Run Lighthouse CI + run: lhci autorun + env: + LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }} diff --git a/lighthouserc.js b/lighthouserc.js new file mode 100644 index 00000000..7ebafb68 --- /dev/null +++ b/lighthouserc.js @@ -0,0 +1,13 @@ +module.exports = { + ci: { + collect: { + staticDistDir: './dist', + url: ['http://localhost:3000'], + numberOfRuns: 5, + }, + upload: { + target: 'temporary-public-storage', + githubAppToken: process.env.LHCI_GITHUB_APP_TOKEN, + }, + }, +};