Skip to content

Commit

Permalink
Merge 0fb8d6c into ee4333d
Browse files Browse the repository at this point in the history
  • Loading branch information
jesuyedavid committed May 10, 2024
2 parents ee4333d + 0fb8d6c commit 82a48a5
Show file tree
Hide file tree
Showing 15 changed files with 132 additions and 37 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/acceptance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ jobs:
name: Headless Acceptance
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js 16
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16
cache: 'npm'
- run: npm ci
- name: Download build-output-US artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: build-output-US
path: dist/
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/acceptance_search_bar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ jobs:
name: Headless Acceptance
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js 16
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16
cache: 'npm'
- run: npm ci
- name: Download build-output-US artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: build-output-US
path: dist/
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node.js 16
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16
cache: 'npm'
- run: npm ci
- run: npm run ${{ inputs.build_script }}
- name: Create build-output-US artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: build-output-US
path: dist/
1 change: 1 addition & 0 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
- hotfix/**
- feature/**-i18n
- release/**
- dev/**

jobs:
call_build:
Expand Down
22 changes: 20 additions & 2 deletions .github/workflows/build_and_deploy_hold.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,34 @@ jobs:
with:
cloud_region: EU

merge_multiple_us_artifacts:
uses: ./.github/workflows/merge_upload_multiple_artifacts.yml
needs:
- call_build
with:
cloud_region: US

merge_multiple_eu_artifacts:
uses: ./.github/workflows/merge_upload_multiple_artifacts.yml
needs:
- call_build_for_eu
with:
cloud_region: EU

call_unit_test:
uses: ./.github/workflows/unit_test.yml
needs: call_build
needs:
- merge_multiple_us_artifacts
- merge_multiple_eu_artifacts

call_misc_tests:
uses: ./.github/workflows/miscellaneous_tests.yml

call_acceptance:
uses: ./.github/workflows/acceptance.yml
needs: call_build
needs:
- merge_multiple_us_artifacts
- merge_multiple_eu_artifacts

call_extract_versions:
uses: ./.github/workflows/extract_versions.yml
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/build_and_deploy_i18n.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
- hotfix/**
- feature/**-i18n
- release/**
- dev/**

jobs:
call_build:
Expand All @@ -31,6 +32,11 @@ jobs:
call_build_locales:
uses: ./.github/workflows/build_i18n.yml

call_build_eu_locales:
uses: ./.github/workflows/build_i18n.yml
with:
cloud_region: EU

call_deploy:
if: github.ref_name != 'develop'
needs:
Expand All @@ -39,6 +45,7 @@ jobs:
- call_acceptance
- call_misc_tests
- call_build_locales
- call_build_eu_locales
uses: ./.github/workflows/deploy.yml
with:
directory: dev/${{ needs.call_format_branch_name.outputs.formatted_branch }}
Expand Down
22 changes: 19 additions & 3 deletions .github/workflows/build_and_deploy_search_bar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,28 @@ jobs:
build_script: build-search-bar-only
cloud_region: EU

call_misc_tests:
uses: ./.github/workflows/miscellaneous_tests.yml
merge_multiple_us_artifacts:
uses: ./.github/workflows/merge_upload_multiple_artifacts.yml
needs:
- call_build
with:
cloud_region: US

merge_multiple_eu_artifacts:
uses: ./.github/workflows/merge_upload_multiple_artifacts.yml
needs:
- call_build_for_eu
with:
cloud_region: EU

call_acceptance_search_bar:
uses: ./.github/workflows/acceptance_search_bar.yml
needs: call_build
needs:
- merge_multiple_us_artifacts
- merge_multiple_eu_artifacts

call_misc_tests:
uses: ./.github/workflows/miscellaneous_tests.yml

call_extract_versions:
uses: ./.github/workflows/extract_versions.yml
Expand Down
22 changes: 16 additions & 6 deletions .github/workflows/build_i18n.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 16
cache: 'npm'
Expand All @@ -36,11 +36,11 @@ jobs:
matrix:
language: ${{ fromJson(needs.create_language_matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node.js 16
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16
cache: 'npm'
Expand All @@ -51,7 +51,17 @@ jobs:
npm run size
fi
- name: Create build-output-${{ inputs.cloud_region }} artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: build-output-${{ inputs.cloud_region }}
name: build-output-${{ inputs.cloud_region }}-${{ matrix.language }}
path: dist/

merge_multiple_artifacts:
needs: build
runs-on: ubuntu-latest
steps:
- name: Merge into build-output-US Artifact
uses: actions/upload-artifact/merge@v4
with:
name: build-output-${{ inputs.cloud_region }}
pattern: build-output-${{ inputs.cloud_region }}-*
29 changes: 26 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ jobs:
deploy-aws:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Download build-output-US artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: build-output-US
path: dist/
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1-node16
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand All @@ -42,3 +42,26 @@ jobs:
--acl public-read \
--recursive \
--cache-control ${{ inputs.cache-control }}
deploy-gcp:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download build-output-EU artifact
uses: actions/download-artifact@v4
with:
name: build-output-EU
path: dist/
- name: Authenticate to Google Cloud
id: auth
uses: google-github-actions/auth@v2
with:
credentials_json: '${{ secrets.GCP_SA_KEY }}'
- name: Deploy to GCP Bucket
uses: google-github-actions/upload-cloud-storage@v2
with:
path: dist/
parent: false
destination: assets-eu.sitescdn.net/${{ inputs.bucket }}/${{ inputs.directory }}
headers: |-
cache-control: ${{ inputs.cache-control }}
14 changes: 7 additions & 7 deletions .github/workflows/deploy_hold.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ jobs:
runs-on: ubuntu-latest
environment: production # sets in github repo with reviewer requirement protection rule
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Download build-output-US artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: build-output-US
path: dist/
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1-node16
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand All @@ -50,19 +50,19 @@ jobs:
runs-on: ubuntu-latest
environment: production # sets in github repo with reviewer requirement protection rule
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Download build-output-EU artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: build-output-EU
path: dist/
- name: Authenticate to Google Cloud
id: auth
uses: google-github-actions/auth@v0
uses: google-github-actions/auth@v2
with:
credentials_json: '${{ secrets.GCP_SA_KEY }}'
- name: Deploy to GCP Bucket
uses: google-github-actions/upload-cloud-storage@v0
uses: google-github-actions/upload-cloud-storage@v2
with:
path: dist/
parent: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ jobs:
image: returntocorp/semgrep
if: (github.actor != 'dependabot[bot]')
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: semgrep ci
20 changes: 20 additions & 0 deletions .github/workflows/merge_upload_multiple_artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Merge and Upload Multiple Artifacts

on:
workflow_call:
inputs:
cloud_region:
required: false
default: US
type: string

jobs:
merge_multiple_artifacts:
runs-on: ubuntu-latest
steps:
- name: Merge into build-output-US Artifact
uses: actions/upload-artifact/merge@v4
with:
name: build-output-${{ inputs.cloud_region }}
pattern: build-output-${{ inputs.cloud_region }}-*
merge-multiple: true
4 changes: 2 additions & 2 deletions .github/workflows/miscellaneous_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js 16
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16
cache: 'npm'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/should_deploy_major_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
outputs:
should_deploy_major_version: ${{ steps.vars.outputs.should_deploy_major_version }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: allow for major version deployment if the next minor version from current tag does not exist
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/unit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js 16
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16
cache: 'npm'
- run: npm ci
- name: Download build-output-US artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: build-output-US
path: dist/
Expand Down

0 comments on commit 82a48a5

Please sign in to comment.