Skip to content

Commit 8ea3b22

Browse files
authored
fix(ci): resolve OOM in Algolia index workflow (#17283)
1 parent e93a518 commit 8ea3b22

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

.github/workflows/algolia-index.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ jobs:
77
index:
88
name: Update Algolia index
99
runs-on: ubuntu-latest
10+
env:
11+
NODE_OPTIONS: '--max-old-space-size=6144'
1012
steps:
1113
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
1214

@@ -28,6 +30,15 @@ jobs:
2830
- 'platform-includes/**'
2931
dev-docs:
3032
- 'develop-docs/**'
33+
34+
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
35+
with:
36+
path: |
37+
${{ github.workspace }}/.next/cache
38+
key: nextjs-${{ runner.os }}-${{ steps.setup-node.outputs.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
39+
restore-keys: |
40+
nextjs-${{ runner.os }}-${{ steps.setup-node.outputs.node-version }}-
41+
3142
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
3243
with:
3344
bun-version: '1.1.34'
@@ -38,7 +49,7 @@ jobs:
3849
# without introducing another dependency like ts-node or tsx for everyone else
3950

4051
- name: Build index for user docs
41-
run: pnpm build && bun ./scripts/algolia.ts
52+
run: pnpm enforce-redirects && pnpm generate-og-images && pnpm generate-doctree && pnpm next build && bun ./scripts/algolia.ts
4253
if: steps.filter.outputs.docs == 'true'
4354
env:
4455
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
@@ -50,7 +61,7 @@ jobs:
5061
NEXT_PUBLIC_SENTRY_DSN: https://examplePublicKey@o0.ingest.sentry.io/0
5162

5263
- name: Build index for developer docs
53-
run: pnpm build:developer-docs && bun ./scripts/algolia.ts
64+
run: git submodule init && git submodule update && pnpm enforce-redirects && pnpm generate-doctree && NEXT_PUBLIC_DEVELOPER_DOCS=1 pnpm next build && bun ./scripts/algolia.ts
5465
if: steps.filter.outputs.dev-docs == 'true'
5566
env:
5667
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}

0 commit comments

Comments
 (0)