diff --git a/.github/workflows/compressed-size.yml b/.github/workflows/compressed-size.yml new file mode 100644 index 0000000000..a838ba4e1f --- /dev/null +++ b/.github/workflows/compressed-size.yml @@ -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}'