Skip to content

Commit

Permalink
Merge 35ca272 into 173cc0e
Browse files Browse the repository at this point in the history
  • Loading branch information
jesuyedavid committed May 10, 2024
2 parents 173cc0e + 35ca272 commit c7b4f53
Show file tree
Hide file tree
Showing 13 changed files with 103 additions and 33 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/
7 changes: 7 additions & 0 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ jobs:
call_build:
uses: ./.github/workflows/build.yml

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

call_unit_test:
uses: ./.github/workflows/unit_test.yml
needs: call_build
Expand All @@ -33,12 +38,14 @@ jobs:
- call_format_branch_name
- call_acceptance
- call_misc_tests
- call_build_eu_locales
uses: ./.github/workflows/deploy.yml
with:
directory: dev/${{ needs.call_format_branch_name.outputs.formatted_branch }}
secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}

concurrency:
group: ci-build-and-deploy-${{ github.ref }}-1
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/build_and_deploy_i18n.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ jobs:
call_build_locales:
uses: ./.github/workflows/build_i18n.yml

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

call_deploy:
if: github.ref_name != 'develop'
needs:
Expand All @@ -39,12 +44,14 @@ jobs:
- call_acceptance
- call_misc_tests
- call_build_locales
- call_build_for_eu_locales
uses: ./.github/workflows/deploy.yml
with:
directory: dev/${{ needs.call_format_branch_name.outputs.formatted_branch }}
secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}

call_deploy_canary:
if: github.ref_name == 'develop'
Expand All @@ -60,6 +67,7 @@ jobs:
secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}

call_deploy_canary_sha:
if: github.ref_name == 'develop'
Expand All @@ -69,13 +77,15 @@ jobs:
- call_acceptance
- call_misc_tests
- call_build_locales
- call_build_for_eu_locales
uses: ./.github/workflows/deploy.yml
with:
directory: canary/${{ github.sha }}
cache-control: 'max-age=31536000'
secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}

concurrency:
group: ci-build-and-deploy-i18n-${{ github.ref }}-1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_and_deploy_search_bar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

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

call_acceptance_search_bar:
uses: ./.github/workflows/acceptance_search_bar.yml
needs: call_build
Expand Down
39 changes: 33 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,34 @@ 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-${{ inputs.cloud_region }} Artifact
uses: actions/upload-artifact/merge@v4
with:
name: build-output-${{ inputs.cloud_region }}-temp
pattern: build-output-${{ inputs.cloud_region }}-*
delete-merged: true

overwrite_artifact:
needs: merge_multiple_artifacts
runs-on: ubuntu-latest
steps:
- name: Download build-output-${{ inputs.cloud_region }}-temp artifact
uses: actions/download-artifact@v4
with:
name: build-output-${{ inputs.cloud_region }}-temp
path: dist/
- name: Overwrite build-output-${{ inputs.cloud_region }} artifact
uses: actions/upload-artifact@v4
with:
name: build-output-${{ inputs.cloud_region }}
path: dist/
overwrite: true
32 changes: 29 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,21 @@ on:
required: true
AWS_SECRET_ACCESS_KEY:
required: true
GCP_SA_KEY:
required: true

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 +44,27 @@ 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
process_gcloudignore: 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
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 c7b4f53

Please sign in to comment.