From 0ae28e5321f253e1967dad1e5c9089ac03c0a8e3 Mon Sep 17 00:00:00 2001 From: Gianfranco Paoloni Date: Wed, 14 Jan 2026 18:46:06 -0300 Subject: [PATCH 01/12] chore: add CI job for aselo-webchat-react-app --- .../action.yml | 142 ++++++++++++++++++ .../workflows/aselo-webchat-react-app-ci.yml | 79 ++++++++++ 2 files changed, 221 insertions(+) create mode 100644 .github/actions/build-and-upload-aselo-webchat-react-app/action.yml create mode 100644 .github/workflows/aselo-webchat-react-app-ci.yml diff --git a/.github/actions/build-and-upload-aselo-webchat-react-app/action.yml b/.github/actions/build-and-upload-aselo-webchat-react-app/action.yml new file mode 100644 index 0000000000..241ae35fee --- /dev/null +++ b/.github/actions/build-and-upload-aselo-webchat-react-app/action.yml @@ -0,0 +1,142 @@ +# Copyright (C) 2021-2024 Technology Matters +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see https://www.gnu.org/licenses/. + +name: build-and-upload-aselo-webchat-react-app +description: 'Build Aselo Webchat React App and upload to S3 bucket' +inputs: + aws-access-key-id: + description: 'AWS credentials for Aselo user' + required: true + aws-secret-access-key: + description: 'AWS credentials for Aselo user' + required: true + aws-region: + description: 'AWS credentials for Aselo user' + required: true + git-reference: + description: 'Identifies the git reference for target key' + default: '' + git-reference-type: + description: 'Identifies if the git reference is a branch or tag' + default: 'tag' +runs: + using: "composite" + steps: + # Setup credentials to access AWS for parameters + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v2 + with: + aws-access-key-id: ${{ inputs.aws-access-key-id }} + aws-secret-access-key: ${{ inputs.aws-secret-access-key }} + aws-region: ${{ inputs.aws-region }} + # Get AWS parameters + # - name: Set Fullstory org id + # uses: "marvinpinto/action-inject-ssm-secrets@latest" + # with: + # ssm_parameter: "FULLSTORY_ID" + # env_variable_name: "FULLSTORY_ID" + + # - name: Create secret.js + # run: | + # touch ./src/private/secret.js + # working-directory: ./plugin-hrm-form + # shell: bash + # - name: Fill secret.js + # run: | + # cat <> ./src/private/secret.js + # export const datadogAccessToken = '$DATADOG_ACCESS_TOKEN'; + # export const datadogApplicationID = '$DATADOG_APP_ID'; + # export const fullStoryId = '$FULLSTORY_ID'; + # EOT + # working-directory: ./plugin-hrm-form + # shell: bash + + # Build aselo-webchat-react-app + - name: Run build command + run: npm run build + working-directory: ./aselo-webchat-react-app + shell: bash + - name: Check bundle was built + if: ${{ hashFiles('aselo-webchat-react-app/build/static/js/webchat.min.js') == '' }} + uses: actions/github-script@v3 + with: + script: | + core.setFailed('Bundle was not built!') + # Zip files individually + # Cloudfront only zips files under 10000000 bytes on the fly, so we need to store these zipped + - name: Zip files + run: | + gzip -9 -v app.css + gzip -9 -v app.js + gzip -9 -v asset-manifest.json + gzip -9 -v index.html + mv app.css.gz app.css + mv app.js.gz app.js + mv asset-manifest.json.gz asset-manifest.json + mv index.html.gz index.html + working-directory: ./aselo-webchat-react-app + shell: bash + - name: Zip js files + run: | + gzip -9 -v webchat.min.js + gzip -9 -v webchat.min.js.map + mv webchat.min.js.gz webchat.min.js + mv webchat.min.js.map.gz webchat.min.js.map + working-directory: ./aselo-webchat-react-app/build/static/js + shell: bash + # Upload to S3 buckets + - name: Upload files to Development S3 bucket + uses: jakejarvis/s3-sync-action@master + with: + args: --acl public-read --follow-symlinks --recursive --exclude '*' --include '*.js' --include '*.json' --include '*.css' --include 'index.html' --content-encoding 'gzip' + env: + AWS_S3_BUCKET: assets-development.tl.techmatters.org + AWS_ACCESS_KEY_ID: ${{ inputs.aws-access-key-id }} + AWS_SECRET_ACCESS_KEY: ${{ inputs.aws-secret-access-key }} + AWS_REGION: ${{ inputs.aws-region }} + SOURCE_DIR: "aselo-webchat-react-app/build/static/js" + DEST_DIR: aselo-webchat-react-app/${{inputs.git-reference-type}}/${{inputs.git-reference}}/static/js + # - name: Upload files to Staging S3 bucket + # uses: jakejarvis/s3-sync-action@master + # with: + # args: --acl public-read --follow-symlinks --exclude '*' --include '*' --content-type 'application/javascript; charset=utf-8' --content-encoding 'gzip' + # env: + # AWS_S3_BUCKET: assets-staging.tl.techmatters.org + # AWS_ACCESS_KEY_ID: ${{ inputs.aws-access-key-id }} + # AWS_SECRET_ACCESS_KEY: ${{ inputs.aws-secret-access-key }} + # AWS_REGION: ${{ inputs.aws-region }} + # SOURCE_DIR: "aselo-webchat-react-app/build/static/js" + # DEST_DIR: aselo-webchat-react-app/${{inputs.git-reference-type}}/${{inputs.git-reference}} + # - name: Upload files to Production S3 bucket + # uses: jakejarvis/s3-sync-action@master + # with: + # args: --acl public-read --follow-symlinks --include '*' --content-type 'application/javascript; charset=utf-8' --content-encoding 'gzip' + # env: + # AWS_S3_BUCKET: assets-production.tl.techmatters.org + # AWS_ACCESS_KEY_ID: ${{ inputs.aws-access-key-id }} + # AWS_SECRET_ACCESS_KEY: ${{ inputs.aws-secret-access-key }} + # AWS_REGION: ${{ inputs.aws-region }} + # SOURCE_DIR: "aselo-webchat-react-app/build/static/js" + # DEST_DIR: aselo-webchat-react-app/${{inputs.git-reference-type}}/${{inputs.git-reference}} + - name: Clear cloudfront caches + shell: bash + run: | + CF_DISTRO=$(aws cloudfront list-distributions --query "DistributionList.Items[*].{id:Id,origin:Origins.Items[0].DomainName}[?origin=='assets-development.tl.techmatters.org.s3-website.us-east-1.amazonaws.com'].id" --output text) + aws cloudfront create-invalidation --distribution-id $CF_DISTRO --paths /aselo-webchat-react-app/${{inputs.git-reference-type}}/${{inputs.git-reference}}/* + + # CF_DISTRO=$(aws cloudfront list-distributions --query "DistributionList.Items[*].{id:Id,origin:Origins.Items[0].DomainName}[?origin=='assets-staging.tl.techmatters.org.s3-website.us-east-1.amazonaws.com'].id" --output text) + # aws cloudfront create-invalidation --distribution-id $CF_DISTRO --paths /aselo-webchat-react-app/${{inputs.git-reference-type}}/${{inputs.git-reference}}/* + + # CF_DISTRO=$(aws cloudfront list-distributions --query "DistributionList.Items[*].{id:Id,origin:Origins.Items[0].DomainName}[?origin=='assets-production.tl.techmatters.org.s3-website.us-east-1.amazonaws.com'].id" --output text) + # aws cloudfront create-invalidation --distribution-id $CF_DISTRO --paths /aselo-webchat-react-app/${{inputs.git-reference-type}}/${{inputs.git-reference}}/* diff --git a/.github/workflows/aselo-webchat-react-app-ci.yml b/.github/workflows/aselo-webchat-react-app-ci.yml new file mode 100644 index 0000000000..deb7f40b3e --- /dev/null +++ b/.github/workflows/aselo-webchat-react-app-ci.yml @@ -0,0 +1,79 @@ +# Copyright (C) 2021-2023 Technology Matters +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see https://www.gnu.org/licenses/. + +name: Aselo Webchat React App CI + +on: + workflow_call: +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout Branch + uses: actions/checkout@v6 + - name: Use Node.js + uses: actions/setup-node@v6 + with: + node-version: '22.x' + - name: Create Temp Files + run: | + touch ./.env + working-directory: ./aselo-webchat-react-app + - name: Install dependencies # this should be moved to an action like .github/actions/install-flex-Plugin once we start sharing code + run: npm ci + - name: Run aselo-webchat-react-app code Lint + run: npm run lint --if-present + working-directory: ./aselo-webchat-react-app + unit-test: + runs-on: ubuntu-latest + steps: + - name: Checkout Branch + uses: actions/checkout@v6 + - name: Use Node.js + uses: actions/setup-node@v6 + with: + node-version: '22.x' + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v5 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: us-east-1 + - name: Run aselo-webchat-react-app tests + run: npm run test + working-directory: ./aselo-webchat-react-app + - name: Publish Test Reports + uses: dorny/test-reporter@v2 + if: success() || failure() # always run even if the previous step fails + with: + name: Unit Tests Report + path: '!(node_modules)/**/junit.xml' + reporter: jest-junit + upload-aselo-webchat-react-app: + runs-on: ubuntu-latest + steps: + - name: Checkout Branch + uses: actions/checkout@v6 + - name: Use Node.js + uses: actions/setup-node@v6 + with: + node-version: '22.x' + - name: Build and Upload Aselo Webchat React App + uses: ./.github/actions/build-and-upload-aselo-webchat-react-app + with: + git-reference-type: ${{ github.ref_type }} + git-reference: ${{ github.ref_name }} + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ secrets.AWS_DEFAULT_REGION }} From dc72752a0cd84e044e62226130cfbf27e51daf36 Mon Sep 17 00:00:00 2001 From: Gianfranco Paoloni Date: Thu, 15 Jan 2026 11:03:47 -0300 Subject: [PATCH 02/12] chore: trigger CI --- .github/workflows/global-ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/global-ci.yml b/.github/workflows/global-ci.yml index c3398cc50a..d881993d0a 100644 --- a/.github/workflows/global-ci.yml +++ b/.github/workflows/global-ci.yml @@ -23,6 +23,9 @@ jobs: webchat-ci: uses: ./.github/workflows/webchat-ci.yml secrets: inherit + aselo-webchat-react-app-ci: + uses: ./.github/workflows/aselo-webchat-react-app-ci.yml + secrets: inherit twilio-lambda-ci: uses: ./.github/workflows/twilio-lambda-ci.yml - secrets: inherit \ No newline at end of file + secrets: inherit From a2f7c9cd2d015aca500cf8c2dec718abb2a179f2 Mon Sep 17 00:00:00 2001 From: Gianfranco Paoloni Date: Thu, 15 Jan 2026 11:09:03 -0300 Subject: [PATCH 03/12] chore: fix CI action --- .../workflows/aselo-webchat-react-app-ci.yml | 49 +++++++++++-------- 1 file changed, 29 insertions(+), 20 deletions(-) diff --git a/.github/workflows/aselo-webchat-react-app-ci.yml b/.github/workflows/aselo-webchat-react-app-ci.yml index deb7f40b3e..612e4d6217 100644 --- a/.github/workflows/aselo-webchat-react-app-ci.yml +++ b/.github/workflows/aselo-webchat-react-app-ci.yml @@ -26,6 +26,9 @@ jobs: uses: actions/setup-node@v6 with: node-version: '22.x' + - name: Install dependencies + run: npm ci + working-directory: ./aselo-webchat-react-app - name: Create Temp Files run: | touch ./.env @@ -44,12 +47,9 @@ jobs: uses: actions/setup-node@v6 with: node-version: '22.x' - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v5 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: us-east-1 + - name: Install dependencies + run: npm ci + working-directory: ./aselo-webchat-react-app - name: Run aselo-webchat-react-app tests run: npm run test working-directory: ./aselo-webchat-react-app @@ -63,17 +63,26 @@ jobs: upload-aselo-webchat-react-app: runs-on: ubuntu-latest steps: - - name: Checkout Branch - uses: actions/checkout@v6 - - name: Use Node.js - uses: actions/setup-node@v6 - with: - node-version: '22.x' - - name: Build and Upload Aselo Webchat React App - uses: ./.github/actions/build-and-upload-aselo-webchat-react-app - with: - git-reference-type: ${{ github.ref_type }} - git-reference: ${{ github.ref_name }} - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ secrets.AWS_DEFAULT_REGION }} + - name: Checkout Branch + uses: actions/checkout@v6 + - name: Use Node.js + uses: actions/setup-node@v6 + with: + node-version: '22.x' + - name: Install dependencies + run: npm ci + working-directory: ./aselo-webchat-react-app + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v5 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: us-east-1 + - name: Build and Upload Aselo Webchat React App + uses: ./.github/actions/build-and-upload-aselo-webchat-react-app + with: + git-reference-type: ${{ github.ref_type }} + git-reference: ${{ github.ref_name }} + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ secrets.AWS_DEFAULT_REGION }} From 61f396d44d78393ceed63cbda5261e5fd010ba3a Mon Sep 17 00:00:00 2001 From: Gianfranco Paoloni Date: Thu, 15 Jan 2026 11:25:36 -0300 Subject: [PATCH 04/12] chore: add --force flag to npm ci step --- .github/workflows/aselo-webchat-react-app-ci.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/aselo-webchat-react-app-ci.yml b/.github/workflows/aselo-webchat-react-app-ci.yml index 612e4d6217..2cd90a9e4b 100644 --- a/.github/workflows/aselo-webchat-react-app-ci.yml +++ b/.github/workflows/aselo-webchat-react-app-ci.yml @@ -27,14 +27,12 @@ jobs: with: node-version: '22.x' - name: Install dependencies - run: npm ci + run: npm ci --force working-directory: ./aselo-webchat-react-app - name: Create Temp Files run: | touch ./.env working-directory: ./aselo-webchat-react-app - - name: Install dependencies # this should be moved to an action like .github/actions/install-flex-Plugin once we start sharing code - run: npm ci - name: Run aselo-webchat-react-app code Lint run: npm run lint --if-present working-directory: ./aselo-webchat-react-app @@ -48,7 +46,7 @@ jobs: with: node-version: '22.x' - name: Install dependencies - run: npm ci + run: npm ci --force working-directory: ./aselo-webchat-react-app - name: Run aselo-webchat-react-app tests run: npm run test @@ -70,7 +68,7 @@ jobs: with: node-version: '22.x' - name: Install dependencies - run: npm ci + run: npm ci --force working-directory: ./aselo-webchat-react-app - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v5 From 09fc0197d85baba27c4432f26eda615b232f49e2 Mon Sep 17 00:00:00 2001 From: Gianfranco Paoloni Date: Thu, 15 Jan 2026 14:37:19 -0300 Subject: [PATCH 05/12] chore: disable CI flag --- .../actions/build-and-upload-aselo-webchat-react-app/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/build-and-upload-aselo-webchat-react-app/action.yml b/.github/actions/build-and-upload-aselo-webchat-react-app/action.yml index 241ae35fee..b1241f3603 100644 --- a/.github/actions/build-and-upload-aselo-webchat-react-app/action.yml +++ b/.github/actions/build-and-upload-aselo-webchat-react-app/action.yml @@ -64,7 +64,7 @@ runs: # Build aselo-webchat-react-app - name: Run build command - run: npm run build + run: CI=false npm run build ## TODO: remove CI=false once lint is fixed working-directory: ./aselo-webchat-react-app shell: bash - name: Check bundle was built From e671b64e44aba8f0c804a344913bf6a7bfdc16b7 Mon Sep 17 00:00:00 2001 From: Gianfranco Paoloni Date: Fri, 16 Jan 2026 11:40:28 -0300 Subject: [PATCH 06/12] chore: remove CI flag --- .../actions/build-and-upload-aselo-webchat-react-app/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/build-and-upload-aselo-webchat-react-app/action.yml b/.github/actions/build-and-upload-aselo-webchat-react-app/action.yml index b1241f3603..c63ce7abd2 100644 --- a/.github/actions/build-and-upload-aselo-webchat-react-app/action.yml +++ b/.github/actions/build-and-upload-aselo-webchat-react-app/action.yml @@ -64,7 +64,7 @@ runs: # Build aselo-webchat-react-app - name: Run build command - run: CI=false npm run build ## TODO: remove CI=false once lint is fixed + run: npm run build ## TODO: remove CI=false once lint is fixed working-directory: ./aselo-webchat-react-app shell: bash - name: Check bundle was built From 219192201521e6e2bbf6084d440c7effa7af400a Mon Sep 17 00:00:00 2001 From: Gianfranco Paoloni Date: Fri, 16 Jan 2026 12:03:23 -0300 Subject: [PATCH 07/12] chore: fix build conflict with prettier --- aselo-webchat-react-app/.eslintrc.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/aselo-webchat-react-app/.eslintrc.json b/aselo-webchat-react-app/.eslintrc.json index cd59da988b..c95c0fc83f 100644 --- a/aselo-webchat-react-app/.eslintrc.json +++ b/aselo-webchat-react-app/.eslintrc.json @@ -2,8 +2,7 @@ "extends": [ "twilio-react", "plugin:react/jsx-runtime", - "plugin:sonarjs/recommended", - "plugin:prettier/recommended" + "plugin:sonarjs/recommended" ], "parser": "@typescript-eslint/parser", "parserOptions": { From 7d28cc57be737e0affdd073bc3b87799ff1f4721 Mon Sep 17 00:00:00 2001 From: Gianfranco Paoloni Date: Fri, 16 Jan 2026 12:11:29 -0300 Subject: [PATCH 08/12] fix: build action source dir --- .../build-and-upload-aselo-webchat-react-app/action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/build-and-upload-aselo-webchat-react-app/action.yml b/.github/actions/build-and-upload-aselo-webchat-react-app/action.yml index c63ce7abd2..a31a8b626f 100644 --- a/.github/actions/build-and-upload-aselo-webchat-react-app/action.yml +++ b/.github/actions/build-and-upload-aselo-webchat-react-app/action.yml @@ -85,7 +85,7 @@ runs: mv app.js.gz app.js mv asset-manifest.json.gz asset-manifest.json mv index.html.gz index.html - working-directory: ./aselo-webchat-react-app + working-directory: ./aselo-webchat-react-app/build shell: bash - name: Zip js files run: | @@ -105,8 +105,8 @@ runs: AWS_ACCESS_KEY_ID: ${{ inputs.aws-access-key-id }} AWS_SECRET_ACCESS_KEY: ${{ inputs.aws-secret-access-key }} AWS_REGION: ${{ inputs.aws-region }} - SOURCE_DIR: "aselo-webchat-react-app/build/static/js" - DEST_DIR: aselo-webchat-react-app/${{inputs.git-reference-type}}/${{inputs.git-reference}}/static/js + SOURCE_DIR: "aselo-webchat-react-app/build" + DEST_DIR: aselo-webchat-react-app/${{inputs.git-reference-type}}/${{inputs.git-reference}} # - name: Upload files to Staging S3 bucket # uses: jakejarvis/s3-sync-action@master # with: From 672fcf5a87bd62deb8797c3a263e10c3cc6e900f Mon Sep 17 00:00:00 2001 From: Gianfranco Paoloni Date: Fri, 16 Jan 2026 12:18:29 -0300 Subject: [PATCH 09/12] fix: remove recursive flag --- .../actions/build-and-upload-aselo-webchat-react-app/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/build-and-upload-aselo-webchat-react-app/action.yml b/.github/actions/build-and-upload-aselo-webchat-react-app/action.yml index a31a8b626f..b541235e60 100644 --- a/.github/actions/build-and-upload-aselo-webchat-react-app/action.yml +++ b/.github/actions/build-and-upload-aselo-webchat-react-app/action.yml @@ -99,7 +99,7 @@ runs: - name: Upload files to Development S3 bucket uses: jakejarvis/s3-sync-action@master with: - args: --acl public-read --follow-symlinks --recursive --exclude '*' --include '*.js' --include '*.json' --include '*.css' --include 'index.html' --content-encoding 'gzip' + args: --acl public-read --follow-symlinks --exclude '*' --include '*.js' --include '*.json' --include '*.css' --include 'index.html' --content-encoding 'gzip' env: AWS_S3_BUCKET: assets-development.tl.techmatters.org AWS_ACCESS_KEY_ID: ${{ inputs.aws-access-key-id }} From 337f9136586914056b9dc66606b78771ed95cc50 Mon Sep 17 00:00:00 2001 From: Gianfranco Paoloni Date: Fri, 16 Jan 2026 12:25:55 -0300 Subject: [PATCH 10/12] fix: include .js.map --- .../actions/build-and-upload-aselo-webchat-react-app/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/build-and-upload-aselo-webchat-react-app/action.yml b/.github/actions/build-and-upload-aselo-webchat-react-app/action.yml index b541235e60..a72062fdfa 100644 --- a/.github/actions/build-and-upload-aselo-webchat-react-app/action.yml +++ b/.github/actions/build-and-upload-aselo-webchat-react-app/action.yml @@ -99,7 +99,7 @@ runs: - name: Upload files to Development S3 bucket uses: jakejarvis/s3-sync-action@master with: - args: --acl public-read --follow-symlinks --exclude '*' --include '*.js' --include '*.json' --include '*.css' --include 'index.html' --content-encoding 'gzip' + args: --acl public-read --follow-symlinks --exclude '*' --include '*.js' --include '*.js.map' --include '*.json' --include '*.css' --include 'index.html' --content-encoding 'gzip' env: AWS_S3_BUCKET: assets-development.tl.techmatters.org AWS_ACCESS_KEY_ID: ${{ inputs.aws-access-key-id }} From 633ad46b7fecef92ed3280e014bef774be39d26e Mon Sep 17 00:00:00 2001 From: Gianfranco Paoloni Date: Fri, 16 Jan 2026 16:20:00 -0300 Subject: [PATCH 11/12] chore: upload artifact to all envs --- .../action.yml | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/.github/actions/build-and-upload-aselo-webchat-react-app/action.yml b/.github/actions/build-and-upload-aselo-webchat-react-app/action.yml index a72062fdfa..b2903f8aa8 100644 --- a/.github/actions/build-and-upload-aselo-webchat-react-app/action.yml +++ b/.github/actions/build-and-upload-aselo-webchat-react-app/action.yml @@ -107,36 +107,36 @@ runs: AWS_REGION: ${{ inputs.aws-region }} SOURCE_DIR: "aselo-webchat-react-app/build" DEST_DIR: aselo-webchat-react-app/${{inputs.git-reference-type}}/${{inputs.git-reference}} - # - name: Upload files to Staging S3 bucket - # uses: jakejarvis/s3-sync-action@master - # with: - # args: --acl public-read --follow-symlinks --exclude '*' --include '*' --content-type 'application/javascript; charset=utf-8' --content-encoding 'gzip' - # env: - # AWS_S3_BUCKET: assets-staging.tl.techmatters.org - # AWS_ACCESS_KEY_ID: ${{ inputs.aws-access-key-id }} - # AWS_SECRET_ACCESS_KEY: ${{ inputs.aws-secret-access-key }} - # AWS_REGION: ${{ inputs.aws-region }} - # SOURCE_DIR: "aselo-webchat-react-app/build/static/js" - # DEST_DIR: aselo-webchat-react-app/${{inputs.git-reference-type}}/${{inputs.git-reference}} - # - name: Upload files to Production S3 bucket - # uses: jakejarvis/s3-sync-action@master - # with: - # args: --acl public-read --follow-symlinks --include '*' --content-type 'application/javascript; charset=utf-8' --content-encoding 'gzip' - # env: - # AWS_S3_BUCKET: assets-production.tl.techmatters.org - # AWS_ACCESS_KEY_ID: ${{ inputs.aws-access-key-id }} - # AWS_SECRET_ACCESS_KEY: ${{ inputs.aws-secret-access-key }} - # AWS_REGION: ${{ inputs.aws-region }} - # SOURCE_DIR: "aselo-webchat-react-app/build/static/js" - # DEST_DIR: aselo-webchat-react-app/${{inputs.git-reference-type}}/${{inputs.git-reference}} + - name: Upload files to Staging S3 bucket + uses: jakejarvis/s3-sync-action@master + with: + args: --acl public-read --follow-symlinks --exclude '*' --include '*.js' --include '*.js.map' --include '*.json' --include '*.css' --include 'index.html' --content-encoding 'gzip' + env: + AWS_S3_BUCKET: assets-staging.tl.techmatters.org + AWS_ACCESS_KEY_ID: ${{ inputs.aws-access-key-id }} + AWS_SECRET_ACCESS_KEY: ${{ inputs.aws-secret-access-key }} + AWS_REGION: ${{ inputs.aws-region }} + SOURCE_DIR: "aselo-webchat-react-app/build" + DEST_DIR: aselo-webchat-react-app/${{inputs.git-reference-type}}/${{inputs.git-reference}} + - name: Upload files to Production S3 bucket + uses: jakejarvis/s3-sync-action@master + with: + args: --acl public-read --follow-symlinks --exclude '*' --include '*.js' --include '*.js.map' --include '*.json' --include '*.css' --include 'index.html' --content-encoding 'gzip' + env: + AWS_S3_BUCKET: assets-production.tl.techmatters.org + AWS_ACCESS_KEY_ID: ${{ inputs.aws-access-key-id }} + AWS_SECRET_ACCESS_KEY: ${{ inputs.aws-secret-access-key }} + AWS_REGION: ${{ inputs.aws-region }} + SOURCE_DIR: "aselo-webchat-react-app/build" + DEST_DIR: aselo-webchat-react-app/${{inputs.git-reference-type}}/${{inputs.git-reference}} - name: Clear cloudfront caches shell: bash run: | CF_DISTRO=$(aws cloudfront list-distributions --query "DistributionList.Items[*].{id:Id,origin:Origins.Items[0].DomainName}[?origin=='assets-development.tl.techmatters.org.s3-website.us-east-1.amazonaws.com'].id" --output text) aws cloudfront create-invalidation --distribution-id $CF_DISTRO --paths /aselo-webchat-react-app/${{inputs.git-reference-type}}/${{inputs.git-reference}}/* - # CF_DISTRO=$(aws cloudfront list-distributions --query "DistributionList.Items[*].{id:Id,origin:Origins.Items[0].DomainName}[?origin=='assets-staging.tl.techmatters.org.s3-website.us-east-1.amazonaws.com'].id" --output text) - # aws cloudfront create-invalidation --distribution-id $CF_DISTRO --paths /aselo-webchat-react-app/${{inputs.git-reference-type}}/${{inputs.git-reference}}/* + CF_DISTRO=$(aws cloudfront list-distributions --query "DistributionList.Items[*].{id:Id,origin:Origins.Items[0].DomainName}[?origin=='assets-staging.tl.techmatters.org.s3-website.us-east-1.amazonaws.com'].id" --output text) + aws cloudfront create-invalidation --distribution-id $CF_DISTRO --paths /aselo-webchat-react-app/${{inputs.git-reference-type}}/${{inputs.git-reference}}/* - # CF_DISTRO=$(aws cloudfront list-distributions --query "DistributionList.Items[*].{id:Id,origin:Origins.Items[0].DomainName}[?origin=='assets-production.tl.techmatters.org.s3-website.us-east-1.amazonaws.com'].id" --output text) - # aws cloudfront create-invalidation --distribution-id $CF_DISTRO --paths /aselo-webchat-react-app/${{inputs.git-reference-type}}/${{inputs.git-reference}}/* + CF_DISTRO=$(aws cloudfront list-distributions --query "DistributionList.Items[*].{id:Id,origin:Origins.Items[0].DomainName}[?origin=='assets-production.tl.techmatters.org.s3-website.us-east-1.amazonaws.com'].id" --output text) + aws cloudfront create-invalidation --distribution-id $CF_DISTRO --paths /aselo-webchat-react-app/${{inputs.git-reference-type}}/${{inputs.git-reference}}/* From fbcc5a233d312e71d26e2b84e9293ec521194bd0 Mon Sep 17 00:00:00 2001 From: Gianfranco Paoloni Date: Tue, 20 Jan 2026 14:36:53 -0300 Subject: [PATCH 12/12] chore: change --force to --legacy-peer-deps flag --- .github/workflows/aselo-webchat-react-app-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/aselo-webchat-react-app-ci.yml b/.github/workflows/aselo-webchat-react-app-ci.yml index 2cd90a9e4b..3d591e7d3c 100644 --- a/.github/workflows/aselo-webchat-react-app-ci.yml +++ b/.github/workflows/aselo-webchat-react-app-ci.yml @@ -27,7 +27,7 @@ jobs: with: node-version: '22.x' - name: Install dependencies - run: npm ci --force + run: npm ci --legacy-peer-deps working-directory: ./aselo-webchat-react-app - name: Create Temp Files run: | @@ -46,7 +46,7 @@ jobs: with: node-version: '22.x' - name: Install dependencies - run: npm ci --force + run: npm ci --legacy-peer-deps working-directory: ./aselo-webchat-react-app - name: Run aselo-webchat-react-app tests run: npm run test @@ -68,7 +68,7 @@ jobs: with: node-version: '22.x' - name: Install dependencies - run: npm ci --force + run: npm ci --legacy-peer-deps working-directory: ./aselo-webchat-react-app - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v5