From 5f166345a801ffd414e7e1a24284a70df1b46e38 Mon Sep 17 00:00:00 2001 From: Hyun Don Moon Date: Sun, 17 Nov 2024 19:38:36 +0900 Subject: [PATCH] create github action for lighthouse ci on push and pr to main --- .github/workflows/lighthouse.yml | 32 ++++++++++++++++++++++++++++++++ .lighthouserc.js | 10 ++++++++++ 2 files changed, 42 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 0000000..4750e01 --- /dev/null +++ b/.github/workflows/lighthouse.yml @@ -0,0 +1,32 @@ +name: Lighthouse Action +run-name: Lighthouse Action +on: + push: + branches: + - main + pull_request: + branches: + - main +jobs: + lhci: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4.2.2 + - name: Setup pnpm + uses: pnpm/action-setup@v4.0.0 + - name: Setup Node.js environment + uses: actions/setup-node@v4.1.0 + with: + node-version: 22 + cache: "pnpm" + - name: Install dependencies + run: pnpm install + - name: Install LightHouse CI + run: pnpm add -g @lhci/cli + - name: Build app + run: pnpm run 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 0000000..8024477 --- /dev/null +++ b/.lighthouserc.js @@ -0,0 +1,10 @@ +module.exports = { + ci: { + upload: { + target: "temporary-public-storage", + }, + assert: { + preset: "lighthouse:recommended", + }, + }, +};