-
Notifications
You must be signed in to change notification settings - Fork 1
145 lines (122 loc) · 5.23 KB
/
chatbot_reindex.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
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 }}