Chatbot Create Index #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Chatbot Create Index | |
on: | |
workflow_dispatch: | |
inputs: | |
environment: | |
description: 'The environment used as target' | |
type: choice | |
required: true | |
default: dev | |
options: | |
- dev | |
- uat | |
- 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_create_index: | |
name: Llama create index (cd_create_index on ${{ matrix.environment }}) | |
# Trigger on a webhook (e.g. trigger create index from CMS) | |
if: github.event_name == 'repository_dispatch' | |
runs-on: codebuild-${{ matrix.environment }}-github-runner-${{ github.run_id }}-${{ github.run_attempt }} | |
strategy: | |
matrix: | |
environment: [ 'dev', 'uat', 'prod' ] | |
fail-fast: false | |
environment: ${{ matrix.environment }} | |
concurrency: | |
group: ${{ github.workflow }}-${{ matrix.environment }} | |
cancel-in-progress: false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 | |
with: | |
role-to-assume: ${{ secrets.IAM_ROLE_CHATBOT_REINDEX }} | |
aws-region: eu-south-1 | |
- name: Chatbot Vector Index | |
uses: ./.github/actions/chatbot | |
with: | |
chatbot_lambda_name: ${{ vars.CHATBOT_LAMBDA_NAME }} | |
manual_create_index: | |
name: Llama create index (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: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 | |
with: | |
role-to-assume: ${{ secrets.IAM_ROLE_CHATBOT_REINDEX }} | |
aws-region: eu-south-1 | |
- name: Chatbot Vector Index | |
uses: ./.github/actions/chatbot | |
with: | |
chatbot_lambda_name: ${{ vars.CHATBOT_LAMBDA_NAME }} |