Repository navigation
🎨 docs: Document the Deployment Theme, Appearance Scales and ClickHou… #1666
This file contains hidden or 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: 'Next.js Bundle Analysis' | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| defaults: | |
| run: | |
| working-directory: ./ | |
| permissions: | |
| contents: read | |
| actions: read | |
| pull-requests: write | |
| env: | |
| NEXT_TELEMETRY_DISABLED: 1 | |
| jobs: | |
| analyze: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| - uses: pnpm/action-setup@v4 | |
| name: Install pnpm | |
| with: | |
| run_install: true | |
| - name: Restore Next.js build cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: .next/cache | |
| key: ${{ runner.os }}-nextjs-${{ hashFiles('pnpm-lock.yaml') }}-${{ hashFiles('**/*.ts', '**/*.tsx', '**/*.mdx') }} | |
| restore-keys: | | |
| ${{ runner.os }}-nextjs-${{ hashFiles('pnpm-lock.yaml') }}- | |
| - name: Run ESLint | |
| run: pnpm lint | |
| - name: Build next.js app | |
| run: pnpm build | |
| - name: Analyze bundle | |
| run: npx -p nextjs-bundle-analysis report | |
| - name: Upload bundle | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: bundle | |
| path: .next/analyze/__bundle_analysis.json | |
| - name: Download base branch bundle stats | |
| uses: dawidd6/action-download-artifact@v6 | |
| if: success() && github.event.number | |
| with: | |
| workflow: nextjs_bundle_analysis.yml | |
| branch: ${{ github.event.pull_request.base.ref }} | |
| path: .next/analyze/base | |
| - name: Compare with base branch bundle | |
| if: success() && github.event.number | |
| run: ls -laR .next/analyze/base && npx -p nextjs-bundle-analysis compare | |
| - name: Get Comment Body | |
| id: get-comment-body | |
| if: success() && github.event.number | |
| run: | | |
| echo "body<<EOF" >> $GITHUB_OUTPUT | |
| echo "$(cat .next/analyze/__bundle_analysis_comment.txt)" >> $GITHUB_OUTPUT | |
| echo EOF >> $GITHUB_OUTPUT | |
| - name: Find Comment | |
| uses: peter-evans/find-comment@v3 | |
| if: success() && github.event.number | |
| id: fc | |
| with: | |
| issue-number: ${{ github.event.number }} | |
| body-includes: '<!-- __NEXTJS_BUNDLE -->' | |
| - name: Create or Update Comment | |
| uses: peter-evans/create-or-update-comment@v4 | |
| if: success() && github.event.number | |
| with: | |
| issue-number: ${{ github.event.number }} | |
| comment-id: ${{ steps.fc.outputs.comment-id }} | |
| body: ${{ steps.get-comment-body.outputs.body }} | |
| edit-mode: replace |