Skip to content

Commit

Permalink
ci(xyz-build): test deploy function
Browse files Browse the repository at this point in the history
  • Loading branch information
caugner committed Mar 8, 2023
1 parent d798a2c commit 4c0e280
Showing 1 changed file with 9 additions and 105 deletions.
114 changes: 9 additions & 105 deletions .github/workflows/xyz-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,28 +28,6 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: actions/checkout@v3
with:
repository: mdn/content
path: mdn/content
# Yes, this means fetch EVERY COMMIT EVER.
# It's probably not sustainable in the far future (e.g. past 2021)
# but for now it's good enough. We'll need all the history
# so we can figure out each document's last-modified date.
fetch-depth: 0

- uses: actions/checkout@v3
with:
repository: mdn/translated-content
path: mdn/translated-content
# See matching warning for mdn/content checkout step
fetch-depth: 0

- uses: actions/checkout@v3
with:
repository: mdn/mdn-contributor-spotlight
path: mdn/mdn-contributor-spotlight

- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
Expand All @@ -62,87 +40,6 @@ jobs:
- name: Print information about CPU
run: cat /proc/cpuinfo

- name: Build everything
env:
# Remember, the mdn/content repo got cloned into `pwd` into a
# sub-folder called "mdn/content"
CONTENT_ROOT: ${{ github.workspace }}/mdn/content/files
CONTENT_TRANSLATED_ROOT: ${{ github.workspace }}/mdn/translated-content/files
CONTRIBUTOR_SPOTLIGHT_ROOT: ${{ github.workspace }}/mdn/mdn-contributor-spotlight/contributors

# 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://yari-demos.developer.allizom.xyz

# Use the stage version of interactive examples.
BUILD_INTERACTIVE_EXAMPLES_BASE_URL: https://interactive-examples.developer.allizom.xyz

# Now is not the time to worry about flaws.
BUILD_FLAW_LEVELS: "*:ignore"

# This is the Google Analytics account ID for developer.mozilla.org
# If it's used on other domains (e.g. stage or dev builds), it's OK
# because ultimately Google Analytics will filter it out since the
# origin domain isn't what that account expects.
#BUILD_GOOGLE_ANALYTICS_ACCOUNT: UA-36116321-5

# This enables the Plus call-to-action banner and the Plus landing page
REACT_APP_ENABLE_PLUS: false

# This adds the ability to sign in (stage only for now)
REACT_APP_DISABLE_AUTH: true

# Use the stage version of interactive examples in react app
REACT_APP_INTERACTIVE_EXAMPLES_BASE_URL: https://interactive-examples.developer.allizom.xyz

# Firefox Accounts and SubPlat settings
REACT_APP_FXA_SIGNIN_URL: /users/fxa/login/authenticate/
REACT_APP_FXA_SETTINGS_URL: https://accounts.stage.mozaws.net/settings/
REACT_APP_MDN_PLUS_SUBSCRIBE_URL: https://accounts.stage.mozaws.net/subscriptions/products/prod_Jtbg9tyGyLRuB0
REACT_APP_MDN_PLUS_5M_PLAN: price_1JFoTYKb9q6OnNsLalexa03p
REACT_APP_MDN_PLUS_5Y_PLAN: price_1JpIPwKb9q6OnNsLJLsIqMp7
REACT_APP_MDN_PLUS_10M_PLAN: price_1K6X7gKb9q6OnNsLi44HdLcC
REACT_APP_MDN_PLUS_10Y_PLAN: price_1K6X8VKb9q6OnNsLFlUcEiu4

# Surveys.
REACT_APP_SURVEY_START_CONTENT_DISCOVERY_2023: 0 # stage
REACT_APP_SURVEY_END_CONTENT_DISCOVERY_2023: 1677672000000 # (new Date("2023-03-01 12:00:00Z")).getTime()
REACT_APP_SURVEY_RATE_FROM_CONTENT_DISCOVERY_2023: 0.0
REACT_APP_SURVEY_RATE_TILL_CONTENT_DISCOVERY_2023: 0.05 # 5%

# Telemetry.
REACT_APP_GLEAN_CHANNEL: stage
REACT_APP_GLEAN_ENABLED: false

# Newsletter
REACT_APP_NEWSLETTER_ENABLED: false

# Placement
REACT_APP_PLACEMENT_ENABLED: false

run: |
# Info about which CONTENT_* environment variables were set and to what.
echo "CONTENT_ROOT=$CONTENT_ROOT"
echo "CONTENT_TRANSLATED_ROOT=$CONTENT_TRANSLATED_ROOT"
# Build the ServiceWorker first
yarn build:sw
yarn build:prepare
# (July 15, 2021) This is a temporary solution. This should become an
# integrated part of 'build:prepare'.
# See https://github.com/mdn/yari/issues/4217
yarn tool popularities
yarn build --locale en-us
du -sh client/build
# Generate sitemap index file
yarn build --sitemap-index
- name: Authenticate with GCP
uses: google-github-actions/auth@v0
with:
Expand All @@ -153,5 +50,12 @@ jobs:
- name: Setup gcloud
uses: google-github-actions/setup-gcloud@v1

- name: Sync build with GCS bucket
run: gsutil -m rsync -d -r client/build/ gs://${{ secrets.GCS_BUCKET }}/
- name: Deploy Function
env:
ORIGIN_MAIN: developer.allizom.xyz
ORIGIN_LIVE_SAMPLES: yari-demos.developer.allizom.xyz
SOURCE_CONTENT: https://storage.googleapis.com/fiji-mdn-content/
SOURCE_CLIENT: https://storage.googleapis.com/fiji-mdn-content/
SOURCE_INTERACTIVE_SAMPLES: https://storage.googleapis.com/fiji-mdn-interactive-examples/
working-directory: gcp/function/
run: npm run deploy-build-clean

0 comments on commit 4c0e280

Please sign in to comment.