Skip to content

Commit 69ca375

Browse files
committed
wip: build fred and upload to test
1 parent 5dbe51f commit 69ca375

File tree

1 file changed

+38
-27
lines changed

1 file changed

+38
-27
lines changed

.github/workflows/test-build.yml

+38-27
Original file line numberDiff line numberDiff line change
@@ -129,20 +129,26 @@ jobs:
129129
repository: mdn/mdn-contributor-spotlight
130130
path: mdn/mdn-contributor-spotlight
131131

132+
- uses: actions/checkout@v4
133+
if: ${{ ! vars.SKIP_BUILD }}
134+
with:
135+
repository: LeoMcA/fer
136+
path: mdn/fred
137+
132138
- name: Setup Node.js environment
133139
if: ${{ ! vars.SKIP_BUILD || ! vars.SKIP_FUNCTION }}
134140
uses: actions/setup-node@v4
135141
with:
136142
node-version-file: ".nvmrc"
137-
cache: ${{ github.event.inputs.rari-ref == '' && 'yarn' || '' }}
143+
# cache: ${{ github.event.inputs.rari-ref == '' && 'yarn' || '' }}
138144

139-
- name: Install all yarn packages
140-
if: ${{ ! vars.SKIP_BUILD }}
141-
run: yarn --frozen-lockfile
142-
env:
143-
# Use a GITHUB_TOKEN to bypass rate limiting for ripgrep and rari.
144-
# See https://github.com/microsoft/vscode-ripgrep#github-api-limit-note
145-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
145+
# - name: Install all yarn packages
146+
# if: ${{ ! vars.SKIP_BUILD }}
147+
# run: yarn --frozen-lockfile
148+
# env:
149+
# # Use a GITHUB_TOKEN to bypass rate limiting for ripgrep and rari.
150+
# # See https://github.com/microsoft/vscode-ripgrep#github-api-limit-note
151+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
146152

147153
- uses: actions/checkout@v4
148154
if: ${{ !( vars.SKIP_BUILD || github.event.inputs.rari-ref == '' ) }}
@@ -179,6 +185,7 @@ jobs:
179185
run: cat /proc/cpuinfo
180186

181187
- name: Build everything
188+
working-directory: mdn/fred
182189
if: ${{ ! vars.SKIP_BUILD }}
183190
env:
184191
# Remember, the mdn/content repo got cloned into `pwd` into a
@@ -192,7 +199,7 @@ jobs:
192199
BASE_URL: "https://test.developer.allizom.org"
193200

194201
# rari
195-
BUILD_OUT_ROOT: "client/build"
202+
BUILD_OUT_ROOT: "out"
196203
LIVE_SAMPLES_BASE_URL: https://live.test.mdnyalp.dev
197204
INTERACTIVE_EXAMPLES_BASE_URL: https://interactive-examples.mdn.allizom.net
198205
ADDITIONAL_LOCALES_FOR_GENERICS_AND_SPAS: de
@@ -252,28 +259,33 @@ jobs:
252259
echo "CONTENT_ROOT=$CONTENT_ROOT"
253260
echo "CONTENT_TRANSLATED_ROOT=$CONTENT_TRANSLATED_ROOT"
254261
echo "BLOG_ROOT=$BLOG_ROOT"
255-
# Build the ServiceWorker first
256-
yarn build:sw
257-
yarn build:client
258-
yarn build:ssr
262+
# # Build the ServiceWorker first
263+
# yarn build:sw
264+
# yarn build:client
265+
# yarn build:ssr
259266
260-
cp assets/nonprod/robots.txt client/build/robots.txt
267+
npm ci
268+
mkdir -p out/static
261269
262-
yarn rari content sync-translated-content
263-
yarn rari git-history
270+
npm run rari content sync-translated-content
271+
npm run rari git-history
264272
265-
yarn rari build --all --issues client/build/issues.json --templ-stats
273+
npm run rari build --all --issues client/build/issues.json --templ-stats
266274
267275
# SSR all pages
268-
yarn render:html
276+
npm run build
277+
node build/ssr.js
278+
cp -r dist/* out/static/
279+
280+
cp ../../assets/nonprod/robots.txt out/robots.txt
269281
270-
# Generate whatsdeployed files.
271-
yarn tool:legacy whatsdeployed --output client/build/_whatsdeployed/code.json
272-
yarn tool:legacy whatsdeployed $CONTENT_ROOT --output client/build/_whatsdeployed/content.json
273-
yarn tool:legacy whatsdeployed $CONTENT_TRANSLATED_ROOT --output client/build/_whatsdeployed/translated-content.json
282+
# # Generate whatsdeployed files.
283+
# yarn tool:legacy whatsdeployed --output client/build/_whatsdeployed/code.json
284+
# yarn tool:legacy whatsdeployed $CONTENT_ROOT --output client/build/_whatsdeployed/content.json
285+
# yarn tool:legacy whatsdeployed $CONTENT_TRANSLATED_ROOT --output client/build/_whatsdeployed/translated-content.json
274286
275-
# Sort DE search index by en-US popularity.
276-
node scripts/reorder-search-index.mjs client/build/en-us/search-index.json client/build/de/search-index.json
287+
# # Sort DE search index by en-US popularity.
288+
# node scripts/reorder-search-index.mjs client/build/en-us/search-index.json client/build/de/search-index.json
277289
278290
- name: Authenticate with GCP
279291
uses: google-github-actions/auth@v2
@@ -288,8 +300,7 @@ jobs:
288300
- name: Sync build
289301
if: ${{ ! vars.SKIP_BUILD }}
290302
run: |-
291-
gsutil -q -m -h "Cache-Control: public, max-age=3600" cp -r client/build/static gs://${{ vars.GCP_BUCKET_NAME }}/main/
292-
gsutil -q -m -h "Cache-Control: public, max-age=3600" rsync -cdrj html,json,txt -y "^static/" client/build gs://${{ vars.GCP_BUCKET_NAME }}/main
303+
gsutil -q -m -h "Cache-Control: public, max-age=3600" cp -r mdn/fred/out gs://${{ vars.GCP_BUCKET_NAME }}/fred
293304
294305
- name: Authenticate with GCP
295306
if: ${{ ! vars.SKIP_FUNCTION }}
@@ -339,7 +350,7 @@ jobs:
339350
--set-env-vars="ORIGIN_MAIN=test.developer.allizom.org" \
340351
--set-env-vars="ORIGIN_LIVE_SAMPLES=live.test.mdnyalp.dev" \
341352
--set-env-vars="ORIGIN_PLAY=test.mdnyalp.dev" \
342-
--set-env-vars="SOURCE_CONTENT=https://storage.googleapis.com/${{ vars.GCP_BUCKET_NAME }}/main/" \
353+
--set-env-vars="SOURCE_CONTENT=https://storage.googleapis.com/${{ vars.GCP_BUCKET_NAME }}/fred/" \
343354
--set-env-vars="SOURCE_API=https://api.developer.allizom.org/" \
344355
--set-env-vars="BSA_ENABLED=true" \
345356
--set-env-vars="SENTRY_DSN=${{ secrets.SENTRY_DSN_CLOUD_FUNCTION }}" \

0 commit comments

Comments
 (0)