@@ -55,11 +55,42 @@ jobs:
5555 - run : npm install github-slugger
5656 - run : node scripts/check-links/index.mjs --diff --base=last-production-deploy --internal-only
5757
58+ # Fast-fail static checks for translator-introduced regressions
59+ # (missing blank line after imports, missing client:load imports).
60+ # Gates both content and translation-only deploy paths.
61+ lint-mdx :
62+ name : Lint MDX
63+ runs-on : ubuntu-latest
64+ steps :
65+ - uses : actions/checkout@v4
66+ - uses : actions/setup-node@v4
67+ with :
68+ node-version : 20
69+ - run : node scripts/lint-mdx.mjs
70+
71+ # MDX parse sweep: compiles every .mdx file with the same remark plugins
72+ # Astro uses, surfaces every parse error in one pass. Astro's locale
73+ # builds halt at the first error, so without this gate broken files
74+ # stay hidden behind whichever one CI happens to hit first.
75+ check-mdx-parse :
76+ name : Check MDX parse
77+ runs-on : ubuntu-latest
78+ steps :
79+ - uses : actions/checkout@v4
80+ - uses : actions/setup-node@v4
81+ with :
82+ node-version : 20
83+ cache : ' npm'
84+ - run : npm ci
85+ env :
86+ PUPPETEER_SKIP_DOWNLOAD : ' 1'
87+ - run : node scripts/check-mdx-parse.mjs
88+
5889 # ──────────────────────────────────────────────────────────────
5990 # Full deploy: English + all locales (on content pushes)
6091 # ──────────────────────────────────────────────────────────────
6192 build-en :
62- needs : check-internal-links
93+ needs : [ check-internal-links, lint-mdx, check-mdx-parse]
6394 runs-on : ubuntu-latest
6495 concurrency :
6596 group : build-en-${{ github.workflow }}-${{ github.ref }}
@@ -85,12 +116,12 @@ jobs:
85116
86117 - name : Build English only
87118 env :
88- NODE_OPTIONS : --max-old-space-size=6144
119+ NODE_OPTIONS : --max-old-space-size=8192
89120 run : npm run prebuild && ASTRO_TELEMETRY_DISABLED=1 BUILD_LOCALES=none npx astro build
90121
91122 - name : Generate markdown exports
92123 env :
93- NODE_OPTIONS : --max-old-space-size=6144
124+ NODE_OPTIONS : --max-old-space-size=8192
94125 run : npm run build:md:prod
95126
96127 - uses : actions/upload-artifact@v4
@@ -100,11 +131,11 @@ jobs:
100131 retention-days : 1
101132
102133 build-locale-full :
103- needs : check-internal-links
134+ needs : [ check-internal-links, lint-mdx, check-mdx-parse]
104135 runs-on : ubuntu-latest
105136 strategy :
106137 matrix :
107- locale : [zh, tr, ru]
138+ locale : [zh, tr, ru, es ]
108139 concurrency :
109140 group : build-locale-full-${{ matrix.locale }}-${{ github.workflow }}-${{ github.ref }}
110141 cancel-in-progress : true
@@ -129,9 +160,19 @@ jobs:
129160
130161 - name : Build locale ${{ matrix.locale }}
131162 env :
132- NODE_OPTIONS : --max-old-space-size=6144
163+ NODE_OPTIONS : --max-old-space-size=8192
133164 run : npm run prebuild && ASTRO_TELEMETRY_DISABLED=1 BUILD_LOCALES=${{ matrix.locale }} npx astro build
134165
166+ # Generate locale .md / llms.txt / llms-full.txt exports into
167+ # build/${{ matrix.locale }}/ so they're included in the artifact.
168+ # Without this, the translation-only deploy (aws s3 sync --delete)
169+ # wipes them from S3 on every translator commit.
170+ - name : Generate locale markdown exports
171+ env :
172+ NODE_OPTIONS : --max-old-space-size=8192
173+ BUILD_LOCALES : ${{ matrix.locale }}
174+ run : npm run build:md:prod
175+
135176 - uses : actions/upload-artifact@v4
136177 with :
137178 name : build-${{ matrix.locale }}
@@ -173,6 +214,11 @@ jobs:
173214 name : build-ru
174215 path : build/ru/
175216
217+ - uses : actions/download-artifact@v4
218+ with :
219+ name : build-es
220+ path : build/es/
221+
176222 - name : Deploy
177223 uses : reggionick/s3-deploy@v4
178224 with :
@@ -193,12 +239,12 @@ jobs:
193239 # Translation-only deploy: build + upload only locale dirs
194240 # ──────────────────────────────────────────────────────────────
195241 build-locale-only :
196- needs : classify
242+ needs : [ classify, lint-mdx, check-mdx-parse]
197243 if : needs.classify.outputs.translation_only == 'true'
198244 runs-on : ubuntu-latest
199245 strategy :
200246 matrix :
201- locale : [zh, tr, ru]
247+ locale : [zh, tr, ru, es ]
202248 concurrency :
203249 group : build-locale-only-${{ matrix.locale }}-${{ github.workflow }}-${{ github.ref }}
204250 cancel-in-progress : true
@@ -223,9 +269,20 @@ jobs:
223269
224270 - name : Build locale ${{ matrix.locale }}
225271 env :
226- NODE_OPTIONS : --max-old-space-size=6144
272+ NODE_OPTIONS : --max-old-space-size=8192
227273 run : npm run prebuild && ASTRO_TELEMETRY_DISABLED=1 BUILD_LOCALES=${{ matrix.locale }} npx astro build
228274
275+ # Generate locale .md / llms.txt / llms-full.txt exports into
276+ # build/${{ matrix.locale }}/ so they land in the artifact. Required
277+ # because the deploy uses `aws s3 sync --delete`, which would
278+ # otherwise remove these files from S3 on every translation-only
279+ # update.
280+ - name : Generate locale markdown exports
281+ env :
282+ NODE_OPTIONS : --max-old-space-size=8192
283+ BUILD_LOCALES : ${{ matrix.locale }}
284+ run : npm run build:md:prod
285+
229286 - uses : actions/upload-artifact@v4
230287 with :
231288 name : build-tr-only-${{ matrix.locale }}
@@ -262,19 +319,25 @@ jobs:
262319 name : build-tr-only-ru
263320 path : build/ru/
264321
322+ - uses : actions/download-artifact@v4
323+ with :
324+ name : build-tr-only-es
325+ path : build/es/
326+
265327 # Sync locale directories to S3 using AWS CLI —
266- # only overwrites zh/, tr/, and ru / prefixes, leaves English untouched.
328+ # only overwrites zh/, tr/, ru/, and es / prefixes, leaves English untouched.
267329 - name : Deploy translations to S3
268330 run : |
269331 aws s3 sync build/zh/ s3://${{ secrets.S3_BUCKET }}/zh/ --delete
270332 aws s3 sync build/tr/ s3://${{ secrets.S3_BUCKET }}/tr/ --delete
271333 aws s3 sync build/ru/ s3://${{ secrets.S3_BUCKET }}/ru/ --delete
334+ aws s3 sync build/es/ s3://${{ secrets.S3_BUCKET }}/es/ --delete
272335
273336 - name : Invalidate locale paths
274337 run : |
275338 aws cloudfront create-invalidation \
276339 --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} \
277- --paths "/zh/*" "/tr/*" "/ru/*"
340+ --paths "/zh/*" "/tr/*" "/ru/*" "/es/*"
278341
279342 - name : Update deployment tag
280343 run : |
0 commit comments