ci: add compressed-size.yml (#1328)

This commit is contained in:
Himself65
2023-03-05 15:47:28 -06:00
committed by GitHub
parent e8dc9809e2
commit bf6d4e1fed

35
.github/workflows/compressed-size.yml vendored Normal file
View File

@@ -0,0 +1,35 @@
name: Compressed Size
on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
registry-url: https://npm.pkg.github.com
scope: '@toeverything'
cache: 'pnpm'
- uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/apps/web/.next/cache
key: ${{ runner.os }}-affine-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
restore-keys: |
${{ runner.os }}-affine-${{ hashFiles('**/pnpm-lock.yaml') }}-
- name: Build
run: |
pnpm install --frozen-lockfile
pnpm run build
- uses: preactjs/compressed-size-action@v2
env:
ENABLE_DEBUG_PAGE: ''
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
build-script: 'export'
pattern: 'apps/web/out/**/*.{js,css,html,json}'