-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (47 loc) · 1.63 KB
/
main.yml
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
name: Deploy Discord Bot
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '22'
- name: Install dependencies
run: |
npm install -g aws-cdk
pip install -r requirements.txt
- name: Bootstrap
run: cdk bootstrap
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
APP_NAME: ${{vars.APP_NAME}}
PINECONE_INDEX_NAME: ${{vars.PINECONE_INDEX_NAME}}
PINECONE_API_KEY: ${{secrets.PINECONE_API_KEY}}
DISCORD_ID: ${{vars.DISCORD_ID}}
DISCORD_PUBLIC_KEY: ${{ secrets.DISCORD_PUBLIC_KEY }}
OPENAI_API_KEY: ${{secrets.OPENAI_API_KEY}}
- name: Deploy
run: cdk deploy --all --require-approval never
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
APP_NAME: ${{vars.APP_NAME}}
PINECONE_INDEX_NAME: ${{vars.PINECONE_INDEX_NAME}}
PINECONE_API_KEY: ${{secrets.PINECONE_API_KEY}}
DISCORD_ID: ${{vars.DISCORD_ID}}
DISCORD_PUBLIC_KEY: ${{ secrets.DISCORD_PUBLIC_KEY }}
OPENAI_API_KEY: ${{secrets.OPENAI_API_KEY}}
- name: Register & Delete Commands
run: cd commands && python3 register_commands.py
env:
DISCORD_ID: ${{vars.DISCORD_ID}}
DISCORD_PUBLIC_KEY: ${{ secrets.DISCORD_PUBLIC_KEY }}
DISCORD_TOKEN: ${{secrets.DISCORD_TOKEN}}