|
30 | 30 | TURBO_ARGS: --cache-dir=.turbo/cache |
31 | 31 |
|
32 | 32 | jobs: |
33 | | - build: |
34 | | - name: Build on ${{ matrix.os }} |
35 | | - runs-on: ${{ matrix.os }} |
36 | | - |
37 | | - strategy: |
38 | | - fail-fast: false |
39 | | - matrix: |
40 | | - os: [ubuntu-slim, windows-latest] |
41 | | - event-name: ${{ github.event_name }} |
42 | | - repo: ${{ github.repository }} |
43 | | - exclude: |
44 | | - - os: windows-latest |
45 | | - # Skipping the Windows build on the merge queue to speed it up |
46 | | - event-name: merge_group |
47 | | - - os: windows-latest |
48 | | - # Skipping the Windows build on the private repo to save on costs |
49 | | - repo: nodejs-private/nodejs.org-private |
| 33 | + build-linux: |
| 34 | + name: Build on Linux |
| 35 | + runs-on: ubuntu-slim |
50 | 36 |
|
51 | 37 | steps: |
52 | 38 | - uses: nodejs/web-team/actions/setup-environment@9f3c83af227d721768d9dbb63009a47ed4f4282f |
|
56 | 42 | # We only want to install required production packages |
57 | 43 | install-flags: --prod |
58 | 44 |
|
59 | | - - name: Use GNU tar instead BSD tar |
60 | | - # This ensures that we use GNU `tar` which is more efficient for extracting caches's |
61 | | - if: matrix.os == 'windows-latest' |
62 | | - shell: cmd |
63 | | - run: echo C:\Program Files\Git\usr\bin>>"%GITHUB_PATH%" |
64 | | - |
65 | 45 | - uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 |
66 | 46 | with: |
67 | 47 | path: ${{ github.workspace }}/apps/site/.next/cache |
|
80 | 60 | TURBOPACK_STATS: ${{ matrix.os == 'ubuntu-slim' }} |
81 | 61 |
|
82 | 62 | - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 |
83 | | - if: matrix.os == 'ubuntu-slim' |
84 | 63 | with: |
85 | 64 | name: webpack-stats |
86 | 65 | path: apps/site/.next/server/webpack-stats.json |
|
96 | 75 | # We want to ensure that static exports for all locales do not occur on `pull_request` events |
97 | 76 | # TODO: The output of this is too large, and it crashes the GitHub Runner |
98 | 77 | NEXT_PUBLIC_STATIC_EXPORT_LOCALE: false # ${{ github.event_name == 'push' }} |
| 78 | + |
| 79 | + build-windows: |
| 80 | + name: Build on windows |
| 81 | + runs-on: windows-latest |
| 82 | + |
| 83 | + if: github.event_name != 'merge_group' || github.repository == 'nodejs/nodejs.org' |
| 84 | + |
| 85 | + steps: |
| 86 | + - uses: nodejs/web-team/actions/setup-environment@9f3c83af227d721768d9dbb63009a47ed4f4282f |
| 87 | + with: |
| 88 | + pnpm: true |
| 89 | + use-version-file: true |
| 90 | + # We only want to install required production packages |
| 91 | + install-flags: --prod |
| 92 | + |
| 93 | + - name: Use GNU tar instead BSD tar |
| 94 | + # This ensures that we use GNU `tar` which is more efficient for extracting caches's |
| 95 | + shell: cmd |
| 96 | + run: echo C:\Program Files\Git\usr\bin>>"%GITHUB_PATH%" |
| 97 | + |
| 98 | + - uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 |
| 99 | + with: |
| 100 | + path: ${{ github.workspace }}/apps/site/.next/cache |
| 101 | + key: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }} |
| 102 | + restore-keys: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}- |
| 103 | + |
| 104 | + - name: Build Next.js |
| 105 | + # We want a ISR build on CI to ensure that regular Next.js builds work as expected. |
| 106 | + run: node_modules/.bin/turbo build ${{ env.TURBO_ARGS }} |
| 107 | + env: |
| 108 | + # We want to ensure we have enough RAM allocated to the Node.js process |
| 109 | + # this should be a last resort in case by any chances the build memory gets too high |
| 110 | + # but in general this should never happen |
| 111 | + NODE_OPTIONS: '--max_old_space_size=4096' |
| 112 | + # See https://github.com/vercel/next.js/pull/81318 |
| 113 | + TURBOPACK_STATS: ${{ matrix.os == 'ubuntu-slim' }} |
| 114 | + |
| 115 | + - name: Build Next.js (Static Export) |
| 116 | + # We want to generate a static build, as it is a requirement of our website. |
| 117 | + run: node_modules/.bin/turbo deploy ${{ env.TURBO_ARGS }} |
| 118 | + env: |
| 119 | + # We want to ensure we have enough RAM allocated to the Node.js process |
| 120 | + # this should be a last resort in case by any chances the build memory gets too high |
| 121 | + # but in general this should never happen |
| 122 | + NODE_OPTIONS: '--max_old_space_size=4096' |
| 123 | + # We want to ensure that static exports for all locales do not occur on `pull_request` events |
| 124 | + # TODO: The output of this is too large, and it crashes the GitHub Runner |
| 125 | + NEXT_PUBLIC_STATIC_EXPORT_LOCALE: false # ${{ github.event_name == 'push' }} |
0 commit comments