Skip to content

Commit

Permalink
Merge branch 'refs/heads/main' into add-waf-resource
Browse files Browse the repository at this point in the history
  • Loading branch information
amanfrinati committed Feb 14, 2025
2 parents 00013c7 + 7dd971c commit 3dc80c2
Show file tree
Hide file tree
Showing 355 changed files with 6,669 additions and 7,873 deletions.
5 changes: 0 additions & 5 deletions .changeset/cyan-dolls-reply.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/eighty-seals-worry.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/modern-hairs-train.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/plenty-buses-hope.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/pretty-gorillas-bow.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/rare-turtles-prove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"nextjs-website": major
---

Add whatsNew section to Overview page
5 changes: 5 additions & 0 deletions .changeset/tough-snakes-roll.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"infrastructure": minor
---

Added docs redirect infrastructure
5 changes: 5 additions & 0 deletions .changeset/twenty-cougars-begin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"nextjs-website": major
---

Add release note page to product section
5 changes: 0 additions & 5 deletions .changeset/weak-monkeys-grab.md

This file was deleted.

53 changes: 53 additions & 0 deletions .github/actions/chatbot/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
name: chatbot
description: Recreate Chatbot LLamaindex Vector Index

inputs:
aws_region:
description: 'The AWS region selected'
required: false
default: 'eu-south-1'
chatbot_lambda_name:
description: the name of the chatbot lambda function
required: true
default: ''

runs:
using: "composite"
steps:
- name: Setup Python
uses: kishaningithub/setup-python-amazon-linux@282d998c8f2c4678ac4f872e4dc3b7d167b59fa7 # v1
with:
python-version: '3.12'

- name: Install poetry with pip
shell: bash
run: |
pip install poetry
- name: Install python libraries
shell: bash
run: |
cd apps/chatbot
poetry config virtualenvs.create false
poetry install --only main --no-interaction
# - name: Run tests
# run: |
# cd apps/chatbot
# poetry run pytest
# coverage report
#

- name: Create Vector Index
shell: bash
run: |
cd apps/chatbot
PYTHONPATH=. CHB_DOCUMENTATION_DIR=${{ github.workspace }}/apps/nextjs-website/out poetry run python src/modules/create_vector_index.py --params config/params.yaml
- name: Restart backend lambda function
env:
CHATBOT_LAMBDA_NAME: ${{ inputs.chatbot_lambda_name }}
shell: bash
run: |
aws lambda update-function-code --function-name "${{ env.CHATBOT_LAMBDA_NAME }}" --image-uri $(aws lambda get-function --function-name "${{ env.CHATBOT_LAMBDA_NAME }}" --query 'Code.ImageUri' --output text)
8 changes: 6 additions & 2 deletions .github/actions/check-nextjs-bundle-size/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ inputs:
upload_path:
description: 'The path where the report should be uploaded'
required: true
environment:
description: 'The environment where the report should be uploaded'
required: true

runs:
using: "composite"
Expand All @@ -20,10 +23,11 @@ runs:
run: npx -p [email protected] report

- name: Upload bundle
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: bundle
name: bundle-${{ inputs.environment }}
path: ${{ inputs.upload_path }}
include-hidden-files: true

- name: Download base branch bundle stats
id: base-branch-stats
Expand Down
145 changes: 145 additions & 0 deletions .github/workflows/chatbot_reindex.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
---
name: Chatbot Reindex

on:
pull_request:
types:
- closed
branches:
- 'main'
workflow_dispatch:
inputs:
environment:
description: 'The environment used as target'
type: choice
required: true
default: dev
options:
- dev
- prod

# Allows external webhook trigger
repository_dispatch:
types:
- webhook

# These permissions are needed to interact with GitHub's OIDC Token endpoint.
permissions:
id-token: write
contents: read

jobs:

cd_deploy:
name: Llama reindex (on ${{ matrix.environment }})
# Trigger when the PR is merged or on a webhook (e.g. trigger deploy from CMS)
if: (github.event_name == 'pull_request' && github.event.pull_request.merged == true) || github.event_name == 'repository_dispatch'
runs-on: codebuild-${{ matrix.environment }}-github-runner-${{ github.run_id }}-${{ github.run_attempt }}
strategy:
matrix:
environment: ['dev']
fail-fast: false

environment: ${{ matrix.environment }}

concurrency:
group: ${{ github.workflow }}-${{ matrix.environment }}
cancel-in-progress: false

steps:
- name: Checkout
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab

- name: Increase action disk space
uses: ./.github/actions/increase-disk-space

- name: Setup Node.JS
uses: ./.github/actions/setup-node

- name: Install dependencies
shell: bash
run: npm ci --audit=false --fund=false

- name: Compile packages
shell: bash
run: npm run compile

- name: Build NextJS Website
uses: ./.github/actions/build-nextjs-website
with:
path_to_gitbook_docs: ${{ github.workspace }}/apps/nextjs-website/docs
cookie_domain_script: ${{ secrets.COOKIE_DOMAIN_SCRIPT }}
allow_crawler: ${{ vars.ALLOW_CRAWLER }}
cognito_user_pool_id: ${{ secrets.NEXT_PUBLIC_COGNITO_USER_POOL_ID }}
cognito_identity_pool_id: ${{ secrets.NEXT_PUBLIC_COGNITO_IDENTITY_POOL_ID }}
cognito_app_client_id: ${{ secrets.NEXT_PUBLIC_COGNITO_USER_POOL_WEB_CLIENT_ID }}
chatbot_host: ${{ vars.NEXT_PUBLIC_CHATBOT_HOST }}
chat_max_history_messages: ${{ vars.NEXT_PUBLIC_CHAT_MAX_HISTORY_MESSAGES }}
website_name: ${{ vars.NEXT_PUBLIC_WEBSITE_NAME }}
organization_name: ${{ vars.NEXT_PUBLIC_ORGANIZATION_NAME }}
organization_logo: ${{ vars.NEXT_PUBLIC_ORGANIZATION_LOGO }}
organization_social_links: ${{ vars.NEXT_PUBLIC_ORGANIZATION_SOCIAL_LINKS }}
chatbot_active: ${{ vars.NEXT_PUBLIC_CHATBOT_ACTIVE }}
cognito_aws_region: 'eu-south-1'
strapi_endpoint: ${{ vars.STRAPI_ENDPOINT }}
strapi_api_token: ${{ secrets.STRAPI_API_TOKEN }}
fetch_from_strapi: ${{ vars.FETCH_FROM_STRAPI }}

- name: Chatbot Vector Index
uses: ./.github/actions/chatbot
with:
chatbot_lambda_name: ${{ vars.CHATBOT_LAMBDA_NAME }}

manual_deploy:
name: Llama reindex (manual on ${{ inputs.environment }})
if: github.event_name == 'workflow_dispatch'
runs-on: codebuild-${{ inputs.environment }}-github-runner-${{ github.run_id }}-${{ github.run_attempt }}
environment: ${{ inputs.environment }}

concurrency:
group: ${{ github.workflow }}-${{ inputs.environment }}
cancel-in-progress: false

steps:
- name: Checkout
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab

- name: Increase action disk space
uses: ./.github/actions/increase-disk-space

- name: Setup Node.JS
uses: ./.github/actions/setup-node

- name: Install dependencies
shell: bash
run: npm ci --audit=false --fund=false

- name: Compile packages
shell: bash
run: npm run compile

- name: Build NextJS Website
uses: ./.github/actions/build-nextjs-website
with:
path_to_gitbook_docs: ${{ github.workspace }}/apps/nextjs-website/docs
cookie_domain_script: ${{ secrets.COOKIE_DOMAIN_SCRIPT }}
allow_crawler: ${{ vars.ALLOW_CRAWLER }}
cognito_user_pool_id: ${{ secrets.NEXT_PUBLIC_COGNITO_USER_POOL_ID }}
cognito_identity_pool_id: ${{ secrets.NEXT_PUBLIC_COGNITO_IDENTITY_POOL_ID }}
cognito_app_client_id: ${{ secrets.NEXT_PUBLIC_COGNITO_USER_POOL_WEB_CLIENT_ID }}
chatbot_host: ${{ vars.NEXT_PUBLIC_CHATBOT_HOST }}
chat_max_history_messages: ${{ vars.NEXT_PUBLIC_CHAT_MAX_HISTORY_MESSAGES }}
website_name: ${{ vars.NEXT_PUBLIC_WEBSITE_NAME }}
organization_name: ${{ vars.NEXT_PUBLIC_ORGANIZATION_NAME }}
organization_logo: ${{ vars.NEXT_PUBLIC_ORGANIZATION_LOGO }}
organization_social_links: ${{ vars.NEXT_PUBLIC_ORGANIZATION_SOCIAL_LINKS }}
chatbot_active: ${{ vars.NEXT_PUBLIC_CHATBOT_ACTIVE }}
cognito_aws_region: 'eu-south-1'
strapi_endpoint: ${{ vars.STRAPI_ENDPOINT }}
strapi_api_token: ${{ secrets.STRAPI_API_TOKEN }}
fetch_from_strapi: ${{ vars.FETCH_FROM_STRAPI }}

- name: Chatbot Vector Index
uses: ./.github/actions/chatbot
with:
chatbot_lambda_name: ${{ vars.CHATBOT_LAMBDA_NAME }}
1 change: 1 addition & 0 deletions .github/workflows/code_review.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,4 @@ jobs:
with:
path_to_nextjs_folder: ./apps/nextjs-website
upload_path: apps/nextjs-website/.next/analyze/__bundle_analysis.json
environment: ${{ matrix.environment }}
5 changes: 5 additions & 0 deletions .github/workflows/code_review_infra.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
submodules: recursive

- name: Setup Node.JS
uses: ./.github/actions/setup-node
Expand All @@ -42,6 +44,9 @@ jobs:
- name: Build Cognito Functions
run: npm run build -w cognito-functions

- name: Pull & update submodules recursively
run: git submodule update --init --recursive

- name: Configure AWS Credentials
uses: ./.github/actions/configure-aws-credentials
with:
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/deploy_ac_sync_lambda.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
run: zip -r function.zip .

- name: Archive build artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: active-campaign-client
path: packages/active-campaign-client/dist/function.zip
Expand All @@ -60,7 +60,7 @@ jobs:

steps:
- name: Download build artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: active-campaign-client
path: ./packages/active-campaign-client/target
Expand All @@ -75,4 +75,10 @@ jobs:
run: |
aws lambda update-function-code \
--function-name ac-${{ github.event.inputs.environment || 'dev' }}-sync-lambda \
--zip-file fileb://packages/active-campaign-client/target/function.zip
- name: Deploy Lambda function (${{ github.event.inputs.environment || 'dev' }})
run: |
aws lambda update-function-code \
--function-name ac-${{ github.event.inputs.environment || 'dev' }}-resync-lambda \
--zip-file fileb://packages/active-campaign-client/target/function.zip
Loading

0 comments on commit 3dc80c2

Please sign in to comment.