Skip to content

Commit

Permalink
DNM: copy de-test-build to xyz-build
Browse files Browse the repository at this point in the history
  • Loading branch information
caugner committed Jun 10, 2024
1 parent bf74fc4 commit 3e7d798
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions .github/workflows/xyz-build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: XYZ Build
name: Test-DE Build

env:
DEFAULT_NOTES: ""
Expand Down Expand Up @@ -30,7 +30,7 @@ permissions:

jobs:
build:
environment: xyz
environment: test-de
runs-on: ubuntu-latest

# Only run the scheduled workflows on the main repo.
Expand Down Expand Up @@ -67,10 +67,12 @@ jobs:
- uses: actions/checkout@v4
if: ${{ ! vars.SKIP_BUILD || ! vars.SKIP_FUNCTION }}
with:
repository: mdn/translated-content
repository: mdn/translated-content-de
ref: wip
path: mdn/translated-content
# See matching warning for mdn/content checkout step
fetch-depth: 0
token: ${{ secrets.MDN_MTC_PAT }}

- uses: actions/checkout@v4
if: ${{ ! vars.SKIP_BUILD }}
Expand Down Expand Up @@ -109,14 +111,14 @@ 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
BASE_URL: "https://developer.allizom.xyz"
BASE_URL: "https://de.test.developer.allizom.org"

# 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
# is not insecure.
BUILD_LIVE_SAMPLES_BASE_URL: https://live.mdnyalp.dev
BUILD_LEGACY_LIVE_SAMPLES_BASE_URL: https://live.mdnyalp.dev
BUILD_LIVE_SAMPLES_BASE_URL: https://live.play.de.test.mdn.allizom.net
BUILD_LEGACY_LIVE_SAMPLES_BASE_URL: https://live.play.de.test.mdn.allizom.net

# Use the stage version of interactive examples.
BUILD_INTERACTIVE_EXAMPLES_BASE_URL: https://interactive-examples.mdn.allizom.net
Expand Down Expand Up @@ -145,7 +147,7 @@ jobs:
# No surveys.

# Telemetry.
REACT_APP_GLEAN_CHANNEL: xyz
REACT_APP_GLEAN_CHANNEL: test-de
REACT_APP_GLEAN_ENABLED: true

# Newsletter
Expand All @@ -155,7 +157,7 @@ jobs:
REACT_APP_PLACEMENT_ENABLED: false

# Playground
REACT_APP_PLAYGROUND_BASE_HOST: mdnyalp.dev
REACT_APP_PLAYGROUND_BASE_HOST: play.de.test.mdn.allizom.net
run: |
# Info about which CONTENT_* environment variables were set and to what.
Expand All @@ -166,11 +168,11 @@ jobs:
yarn build:sw
yarn build:prepare
yarn tool sync-translated-content
#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
for locale in en-us de; do
yarn build --locale $locale 2>&1 | sed "s/^/[$locale] /" &
pids+=($!)
done
Expand Down Expand Up @@ -199,7 +201,7 @@ jobs:
uses: google-github-actions/auth@v2
with:
token_format: access_token
service_account: deploy-xyz-yari@${{ secrets.GCP_PROJECT_NAME }}.iam.gserviceaccount.com
service_account: deploy-test-de-content@${{ secrets.GCP_PROJECT_NAME }}.iam.gserviceaccount.com
workload_identity_provider: projects/${{ secrets.WIP_PROJECT_ID }}/locations/global/workloadIdentityPools/github-actions/providers/github-actions

- name: Setup gcloud
Expand All @@ -216,7 +218,7 @@ jobs:
uses: google-github-actions/auth@v2
with:
token_format: access_token
service_account: deploy-xyz-yari@${{ secrets.GCP_PROJECT_NAME }}.iam.gserviceaccount.com
service_account: deploy-test-de-nonprod-mdn-ing@${{ secrets.GCP_PROJECT_NAME }}.iam.gserviceaccount.com
workload_identity_provider: projects/${{ secrets.WIP_PROJECT_ID }}/locations/global/workloadIdentityPools/github-actions/providers/github-actions

- name: Setup gcloud
Expand All @@ -238,8 +240,8 @@ jobs:
- name: Deploy Function
if: ${{ ! vars.SKIP_FUNCTION }}
run: |-
for region in europe-west1 us-west1 asia-east1; do
gcloud beta functions deploy mdn-xyz-$region \
for region in europe-west3; do
gcloud beta functions deploy mdn-nonprod-test-de-$region \
--gen2 \
--runtime=nodejs18 \
--region=$region \
Expand All @@ -252,13 +254,13 @@ jobs:
--max-instances=100 \
--memory=2GB \
--timeout=120s \
--set-env-vars="ORIGIN_MAIN=developer.allizom.xyz" \
--set-env-vars="ORIGIN_LIVE_SAMPLES=live.mdnyalp.dev" \
--set-env-vars="ORIGIN_PLAY=mdnyalp.dev" \
--set-env-vars="ORIGIN_MAIN=de.test.developer.allizom.org" \
--set-env-vars="ORIGIN_LIVE_SAMPLES=live.play.de.test.mdn.allizom.net" \
--set-env-vars="ORIGIN_PLAY=play.de.test.mdn.allizom.net" \
--set-env-vars="SOURCE_CONTENT=https://storage.googleapis.com/${{ vars.GCP_BUCKET_NAME }}/main/" \
--set-env-vars="SOURCE_API=https://api.developer.allizom.org/" \
--set-env-vars="SENTRY_DSN=${{ secrets.SENTRY_DSN_CLOUD_FUNCTION }}" \
--set-env-vars="SENTRY_ENVIRONMENT=xyz" \
--set-env-vars="SENTRY_ENVIRONMENT=test-de" \
--set-env-vars="SENTRY_TRACES_SAMPLE_RATE=${{ vars.SENTRY_TRACES_SAMPLE_RATE }}" \
--set-env-vars="SENTRY_RELEASE=${{ github.sha }}" \
--set-secrets="KEVEL_SITE_ID=projects/${{ secrets.GCP_PROJECT_NAME }}/secrets/stage-kevel-site-id/versions/latest" \
Expand Down

0 comments on commit 3e7d798

Please sign in to comment.