SP-668 페이지별 성능 측정 tool(LightHouse) 자동화 환경 구축 #37
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run lighthouse CI When Push on PR | |
on: | |
pull_request: | |
branches: | |
- dev | |
types: [opened, edited, synchronize, reopened] | |
permissions: | |
contents: read | |
pull-requests: write | |
jobs: | |
lhci: | |
name: Lighthouse CI | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Use Node.js 20.10.0 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.10.0 | |
- name: Install dependencies | |
run: | | |
yarn install --immutable --immutable-cache --check-cache | |
- name: Add host "local.ludo.study" | |
run: sudo echo "127.0.0.1 local.ludo.study" | sudo tee -a /etc/hosts | |
- name: Build the project | |
run: | | |
yarn build | |
- name: Run Lighthouse CI - Desktop | |
env: | |
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }} | |
run: | | |
yarn global add @lhci/cli | |
lhci collect --config=lighthouserc-desktop.cjs || echo "Fail to Run Lighthouse CI!" | |
lhci upload --config=lighthouserc-desktop.cjs || echo "Fail to Run Lighthouse CI!" | |
- name: Run Lighthouse CI - Mobile | |
env: | |
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }} | |
run: | | |
lhci collect --config=lighthouserc-mobile.cjs || echo "Fail to Run Lighthouse CI!" | |
lhci upload --config=lighthouserc-mobile.cjs || echo "Fail to Run Lighthouse CI!" | |