Skip to content

Commit

Permalink
Merge branch 'main' into 11276-search-field-border
Browse files Browse the repository at this point in the history
  • Loading branch information
argl authored Dec 6, 2024
2 parents d57cadc + 3e781a0 commit 3d6f5f8
Show file tree
Hide file tree
Showing 255 changed files with 11,720 additions and 7,232 deletions.
1 change: 1 addition & 0 deletions .env-dist
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
CONTENT_ROOT=../content/files
#CONTENT_TRANSLATED_ROOT=../translated-content/files
#CONTRIBUTOR_SPOTLIGHT_ROOT=../mdn-contributor-spotlight/contributors
#GENERIC_CONTENT_ROOT=../generic-content/files

REACT_APP_DEV_MODE=true

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/dev-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ jobs:
yarn tool whatsdeployed $CONTENT_ROOT --output client/build/_whatsdeployed/content.json
yarn tool whatsdeployed $CONTENT_TRANSLATED_ROOT --output client/build/_whatsdeployed/translated-content.json
# Sort DE search index by en-US popularity.
node scripts/reorder-search-index.mjs client/build/en-us/search-index.json client/build/de/search-index.json
- name: Deploy with deployer
env:
# Set the CONTENT_ROOT first
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

steps:
- name: Release
uses: google-github-actions/release-please-action@v4
uses: googleapis/release-please-action@v4
id: release

- name: Checkout
Expand Down
41 changes: 34 additions & 7 deletions .github/workflows/prod-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ jobs:
lfs: true
token: ${{ secrets.MDN_STUDIO_PAT }}

- uses: actions/checkout@v4
if: ${{ ! vars.SKIP_BUILD }}
with:
repository: mdn/generic-content
path: mdn/generic-content

- uses: actions/checkout@v4
if: ${{ ! vars.SKIP_BUILD }}
with:
Expand All @@ -115,6 +121,19 @@ jobs:
# See matching warning for mdn/content checkout step
fetch-depth: 0

- name: Checkout (translated-content-de)
uses: actions/checkout@v4
if: ${{ ! vars.SKIP_BUILD || ! vars.SKIP_FUNCTION }}
with:
repository: mdn/translated-content-de
path: mdn/translated-content-de

- name: Move de into translated-content
if: ${{ ! vars.SKIP_BUILD || ! vars.SKIP_FUNCTION }}
run: |
mv mdn/translated-content-de/files/de mdn/translated-content/files/
rm -rf mdn/translated-content-de
- uses: actions/checkout@v4
if: ${{ ! vars.SKIP_BUILD }}
with:
Expand Down Expand Up @@ -176,6 +195,7 @@ jobs:
CONTRIBUTOR_SPOTLIGHT_ROOT: ${{ github.workspace }}/mdn/mdn-contributor-spotlight/contributors
BLOG_ROOT: ${{ github.workspace }}/mdn/mdn-studio/content/posts
CURRICULUM_ROOT: ${{ github.workspace }}/mdn/curriculum
GENERIC_CONTENT_ROOT: ${{ github.workspace }}/mdn/generic-content/files
BASE_URL: "https://developer.mozilla.org"

# The default for this environment variable is geared for writers
Expand Down Expand Up @@ -225,10 +245,14 @@ jobs:
REACT_APP_MDN_PLUS_10Y_PLAN: price_1KeG02JNcmPzuWtRlrSiLTI6

# Surveys.
REACT_APP_SURVEY_START_WEB_APP_AUGUST_2024: 1722816000000 # new Date("2024-08-05Z").getTime()
REACT_APP_SURVEY_END_WEB_APP_AUGUST_2024: 1723593600000 # new Date("2024-08-14Z").getTime()
REACT_APP_SURVEY_RATE_FROM_WEB_APP_AUGUST_2024: 0.0
REACT_APP_SURVEY_RATE_TILL_WEB_APP_AUGUST_2024: 0.05 # 5%
REACT_APP_SURVEY_START_HOMEPAGE_FEEDBACK_2024: 1731369600000 # new Date("2024-11-12Z").getTime()
REACT_APP_SURVEY_END_HOMEPAGE_FEEDBACK_2024: 1733616000000 # new Date("2024-12-08Z").getTime()
REACT_APP_SURVEY_RATE_FROM_HOMEPAGE_FEEDBACK_2024: 0.0
REACT_APP_SURVEY_RATE_TILL_HOMEPAGE_FEEDBACK_2024: 1 # 100%
REACT_APP_SURVEY_START_WEBDX_EDITING_2024: 1731628800000 # new Date("2024-11-15Z").getTime()
REACT_APP_SURVEY_END_WEBDX_EDITING_2024: 1732320000000 # new Date("2024-11-23Z").getTime()
REACT_APP_SURVEY_RATE_FROM_WEBDX_EDITING_2024: 0.0
REACT_APP_SURVEY_RATE_TILL_WEBDX_EDITING_2024: 0.1 # 10%

# Telemetry.
REACT_APP_GLEAN_CHANNEL: prod
Expand Down Expand Up @@ -263,11 +287,11 @@ jobs:
yarn build:sw
yarn build:prepare
yarn tool sync-translated-content
yarn tool sync-translated-content es fr ja ko pt-br ru zh-cn zh-tw
# Build using one process per locale.
# Note: We have 4 cores, but 9 processes is a reasonable number.
for locale in en-us es fr ja ko pt-br ru zh-cn zh-tw; do
for locale in en-us de es fr ja ko pt-br ru zh-cn zh-tw; do
yarn build:docs --locale $locale 2>&1 | sed "s/^/[$locale] /" &
pids+=($!)
done
Expand Down Expand Up @@ -295,6 +319,9 @@ jobs:
yarn tool whatsdeployed $CONTENT_ROOT --output client/build/_whatsdeployed/content.json
yarn tool whatsdeployed $CONTENT_TRANSLATED_ROOT --output client/build/_whatsdeployed/translated-content.json
# Sort DE search index by en-US popularity.
node scripts/reorder-search-index.mjs client/build/en-us/search-index.json client/build/de/search-index.json
- name: Update search index
if: ${{ ! vars.SKIP_BUILD }}
env:
Expand Down Expand Up @@ -354,7 +381,7 @@ jobs:
for region in europe-west1 us-west1 asia-east1; do
gcloud beta functions deploy mdn-prod-prod-$region \
--gen2 \
--runtime=nodejs18 \
--runtime=nodejs20 \
--region=$region \
--source=cloud-function \
--trigger-http \
Expand Down
73 changes: 48 additions & 25 deletions .github/workflows/stage-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ jobs:
git checkout main
git status
git checkout -
git merge main --no-edit
git merge main --no-edit || git merge --abort
- uses: actions/checkout@v4
if: ${{ ! vars.SKIP_BUILD || ! vars.SKIP_FUNCTION }}
Expand All @@ -124,6 +124,12 @@ jobs:
lfs: true
token: ${{ secrets.MDN_STUDIO_PAT }}

- uses: actions/checkout@v4
if: ${{ ! vars.SKIP_BUILD }}
with:
repository: mdn/generic-content
path: mdn/generic-content

- uses: actions/checkout@v4
if: ${{ ! vars.SKIP_BUILD }}
with:
Expand All @@ -138,6 +144,26 @@ jobs:
# See matching warning for mdn/content checkout step
fetch-depth: 0

- name: Checkout (translated-content-de)
uses: actions/checkout@v4
if: ${{ ! vars.SKIP_BUILD || ! vars.SKIP_FUNCTION }}
with:
repository: mdn/translated-content-de
path: mdn/translated-content-de

- name: Move de into translated-content
if: ${{ ! vars.SKIP_BUILD || ! vars.SKIP_FUNCTION }}
run: |
mv mdn/translated-content-de/files/de mdn/translated-content/files/
rm -rf mdn/translated-content-de
- name: Clean and commit de
if: ${{ ! vars.SKIP_BUILD || ! vars.SKIP_FUNCTION }}
working-directory: mdn/translated-content
run: |
git add files/de
git -c user.name='MDN' -c user.email='[email protected]' commit -m 'de'
- uses: actions/checkout@v4
if: ${{ ! vars.SKIP_BUILD }}
with:
Expand All @@ -155,7 +181,8 @@ jobs:
if: ${{ ! vars.SKIP_BUILD }}
run: yarn --frozen-lockfile
env:
# https://github.com/microsoft/vscode-ripgrep#github-api-limit-note
# Use a GITHUB_TOKEN to bypass rate limiting for ripgrep and rari.
# See https://github.com/microsoft/vscode-ripgrep#github-api-limit-note
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install Python
Expand Down Expand Up @@ -199,8 +226,15 @@ jobs:
CONTRIBUTOR_SPOTLIGHT_ROOT: ${{ github.workspace }}/mdn/mdn-contributor-spotlight/contributors
BLOG_ROOT: ${{ github.workspace }}/mdn/mdn-studio/content/posts
CURRICULUM_ROOT: ${{ github.workspace }}/mdn/curriculum
GENERIC_CONTENT_ROOT: ${{ github.workspace }}/mdn/generic-content/files
BASE_URL: "https://developer.allizom.org"

# rari
BUILD_OUT_ROOT: "client/build"
LIVE_SAMPLES_BASE_URL: https://live.mdnyalp.dev
INTERACTIVE_EXAMPLES_BASE_URL: https://interactive-examples.mdn.allizom.net
ADDITIONAL_LOCALES_FOR_GENERICS_AND_SPAS: de

# The default for this environment variable is geared for writers
# (aka. local development). Usually defaults are supposed to be for
# secure production but this is an exception and default
Expand Down Expand Up @@ -277,31 +311,17 @@ jobs:
echo "BLOG_ROOT=$BLOG_ROOT"
# Build the ServiceWorker first
yarn build:sw
yarn build:prepare
yarn tool sync-translated-content
# Build using one process per locale.
# Note: We have 4 cores, but 9 processes is a reasonable number.
for locale in en-us es fr ja ko pt-br ru zh-cn zh-tw; do
yarn build:docs --locale $locale 2>&1 | sed "s/^/[$locale] /" &
pids+=($!)
done
yarn build:client
yarn build:ssr
yarn tool build-robots-txt
for pid in "${pids[@]}"; do
wait $pid
done
yarn rari content sync-translated-content
yarn rari git-history
du -sh client/build
yarn rari build --all --issues client/build/issues.json --templ-stats
# Build the blog
yarn build:blog
# Build the curriculum
yarn build:curriculum
# Generate sitemap index file
yarn build --sitemap-index
# Sort DE search index by en-US popularity.
node scripts/reorder-search-index.mjs client/build/en-us/search-index.json client/build/de/search-index.json
# SSR all pages
yarn render:html
Expand All @@ -311,6 +331,9 @@ jobs:
yarn tool whatsdeployed $CONTENT_ROOT --output client/build/_whatsdeployed/content.json
yarn tool whatsdeployed $CONTENT_TRANSLATED_ROOT --output client/build/_whatsdeployed/translated-content.json
# Sort DE search index by en-US popularity.
node scripts/reorder-search-index.mjs client/build/en-us/search-index.json client/build/de/search-index.json
- name: Update search index
if: ${{ ! vars.SKIP_BUILD }}
env:
Expand Down Expand Up @@ -370,7 +393,7 @@ jobs:
for region in europe-west1 us-west1 asia-east1; do
gcloud beta functions deploy mdn-nonprod-stage-$region \
--gen2 \
--runtime=nodejs18 \
--runtime=nodejs20 \
--region=$region \
--source=cloud-function \
--trigger-http \
Expand Down
73 changes: 47 additions & 26 deletions .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ jobs:
lfs: true
token: ${{ secrets.MDN_STUDIO_PAT }}

- uses: actions/checkout@v4
if: ${{ ! vars.SKIP_BUILD }}
with:
repository: mdn/generic-content
path: mdn/generic-content

- uses: actions/checkout@v4
if: ${{ ! vars.SKIP_BUILD }}
with:
Expand All @@ -72,6 +78,26 @@ jobs:
# See matching warning for mdn/content checkout step
fetch-depth: 0

- name: Checkout (translated-content-de)
uses: actions/checkout@v4
if: ${{ ! vars.SKIP_BUILD || ! vars.SKIP_FUNCTION }}
with:
repository: mdn/translated-content-de
path: mdn/translated-content-de

- name: Move de into translated-content
if: ${{ ! vars.SKIP_BUILD || ! vars.SKIP_FUNCTION }}
run: |
mv mdn/translated-content-de/files/de mdn/translated-content/files/
rm -rf mdn/translated-content-de
- name: Clean and commit de
if: ${{ ! vars.SKIP_BUILD || ! vars.SKIP_FUNCTION }}
working-directory: mdn/translated-content
run: |
git add files/de
git -c user.name='MDN' -c user.email='[email protected]' commit -m 'de'
- uses: actions/checkout@v4
if: ${{ ! vars.SKIP_BUILD }}
with:
Expand All @@ -89,7 +115,8 @@ jobs:
if: ${{ ! vars.SKIP_BUILD }}
run: yarn --frozen-lockfile
env:
# https://github.com/microsoft/vscode-ripgrep#github-api-limit-note
# Use a GITHUB_TOKEN to bypass rate limiting for ripgrep and rari.
# See https://github.com/microsoft/vscode-ripgrep#github-api-limit-note
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Print information about build
Expand All @@ -109,8 +136,15 @@ jobs:
CONTRIBUTOR_SPOTLIGHT_ROOT: ${{ github.workspace }}/mdn/mdn-contributor-spotlight/contributors
BLOG_ROOT: ${{ github.workspace }}/mdn/mdn-studio/content/posts
CURRICULUM_ROOT: ${{ github.workspace }}/mdn/curriculum
GENERIC_CONTENT_ROOT: ${{ github.workspace }}/mdn/generic-content/files
BASE_URL: "https://test.developer.allizom.org"

# rari
BUILD_OUT_ROOT: "client/build"
LIVE_SAMPLES_BASE_URL: https://live.test.mdnyalp.dev
INTERACTIVE_EXAMPLES_BASE_URL: https://interactive-examples.mdn.allizom.net
ADDITIONAL_LOCALES_FOR_GENERICS_AND_SPAS: de

# The default for this environment variable is geared for writers
# (aka. local development). Usually defaults are supposed to be for
# secure production but this is an exception and default
Expand Down Expand Up @@ -155,7 +189,7 @@ jobs:
REACT_APP_PLACEMENT_ENABLED: true

# Playground
REACT_APP_PLAYGROUND_BASE_HOST: play.test.mdn.allizom.net
REACT_APP_PLAYGROUND_BASE_HOST: test.mdnyalp.dev

# Observatory
REACT_APP_OBSERVATORY_API_URL: https://observatory-api.mdn.allizom.net
Expand All @@ -168,31 +202,14 @@ jobs:
echo "BLOG_ROOT=$BLOG_ROOT"
# Build the ServiceWorker first
yarn build:sw
yarn build:prepare
#yarn tool sync-translated-content
# Build using one process per locale.
# Note: We have 4 cores, but 9 processes is a reasonable number.
for locale in en-us fr; do
yarn build:docs --locale $locale 2>&1 | sed "s/^/[$locale] /" &
pids+=($!)
done
for pid in "${pids[@]}"; do
wait $pid
done
yarn build:client
yarn build:ssr
yarn tool build-robots-txt
du -sh client/build
yarn rari content sync-translated-content
yarn rari git-history
# Build the blog
yarn build:blog
# Build the curriculum
yarn build:curriculum
# Generate sitemap index file
yarn build --sitemap-index
yarn rari build --all --issues client/build/issues.json --templ-stats
# SSR all pages
yarn render:html
Expand All @@ -202,6 +219,9 @@ jobs:
yarn tool whatsdeployed $CONTENT_ROOT --output client/build/_whatsdeployed/content.json
yarn tool whatsdeployed $CONTENT_TRANSLATED_ROOT --output client/build/_whatsdeployed/translated-content.json
# Sort DE search index by en-US popularity.
node scripts/reorder-search-index.mjs client/build/en-us/search-index.json client/build/de/search-index.json
- name: Authenticate with GCP
uses: google-github-actions/auth@v2
with:
Expand Down Expand Up @@ -241,6 +261,7 @@ jobs:
run: |
npm ci
npm run build-redirects
npm run build-canonicals
- name: Deploy Function
if: ${{ ! vars.SKIP_FUNCTION }}
Expand All @@ -250,7 +271,7 @@ jobs:
for region in europe-west3; do
gcloud beta functions deploy mdn-nonprod-test-$region \
--gen2 \
--runtime=nodejs18 \
--runtime=nodejs20 \
--region=$region \
--source=cloud-function \
--trigger-http \
Expand Down
Loading

0 comments on commit 3d6f5f8

Please sign in to comment.