-
Notifications
You must be signed in to change notification settings - Fork 1
74 lines (63 loc) · 2.37 KB
/
deploy.yaml
File metadata and controls
74 lines (63 loc) · 2.37 KB
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
name: Deploy
on:
push:
branches:
- main
jobs:
deploy-production:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
environment: production
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Checkout Repo
uses: actions/checkout@v4
- name: Configure AWS Credentials for CI
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-west-2
role-to-assume: arn:aws:iam::488659951590:role/ci-role-d4fe904 # ciRoleArn from defang-io/infrastructure stack
- name: Configure AWS Credentials for Corp Website Account
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-east-1
role-chaining: true
role-duration-seconds: 1200
role-to-assume: arn:aws:iam::407839483216:role/admin
- name: Set up cache for pip dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('app/requirements.txt') }}
- name: Install Python dependencies
working-directory: ./app
run: pip install -r requirements.txt
- name: Update knowledge_base.json
working-directory: ./app
run: python3 get_knowledge_base.py
- name: Run tests for Intercom integration
working-directory: ./app
run: python3 test_intercom.py
- name: Deploy
uses: DefangLabs/defang-github-action@v1.1.3
with:
cli-version: nightly
config-env-vars: ASK_TOKEN OPENAI_API_KEY REBUILD_TOKEN SECRET_KEY SEGMENT_WRITE_KEY DISCORD_APP_ID DISCORD_TOKEN DISCORD_PUBLIC_KEY INTERCOM_TOKEN INTERCOM_ADMIN_ID
mode: staging
provider: aws
env:
ASK_TOKEN: ${{ secrets.ASK_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
REBUILD_TOKEN: ${{ secrets.REBUILD_TOKEN }}
SECRET_KEY: ${{ secrets.SECRET_KEY }}
SEGMENT_WRITE_KEY: ${{ secrets.SEGMENT_WRITE_KEY }}
DISCORD_APP_ID: ${{ secrets.DISCORD_APP_ID }}
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
DISCORD_PUBLIC_KEY: ${{ secrets.DISCORD_PUBLIC_KEY }}
INTERCOM_TOKEN: ${{ secrets.INTERCOM_TOKEN }}
INTERCOM_ADMIN_ID: ${{ secrets.INTERCOM_ADMIN_ID }}