-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (44 loc) · 2.09 KB
/
deploy-preprod-to-azurevm.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
name: Deploy the pre-prod branch code to an Azure Virtual Machine
on:
push:
branches: [ pre-prod ]
jobs:
deployment:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Copy files using SCP
uses: appleboy/scp-action@master
with:
host: ${{ secrets.PANKB_PREPROD_HOST }}
username: ${{ secrets.PANKB_PREPROD_SSH_USERNAME }}
key: ${{ secrets.PANKB_PREPROD_PRIVATE_SSH_KEY }}
source: "."
target: "/projects/pankb_web/pankb_llm"
- name: Create the .env file and (re-)start containers over SSH
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.PANKB_PREPROD_HOST }}
username: ${{ secrets.PANKB_PREPROD_SSH_USERNAME }}
key: ${{ secrets.PANKB_PREPROD_PRIVATE_SSH_KEY }}
port: 22
script: |
cd /projects/pankb_web/pankb_llm
touch .env
echo "## Do not put this file under version control!" > .env
echo "" >> .env
echo OPENAI_API_KEY="${{secrets.OPENAI_API_KEY}}" >> .env
echo COHERE_API_KEY="${{secrets.COHERE_API_KEY}}" >> .env
echo TOGETHER_API_KEY="${{secrets.TOGETHER_API_KEY}}" >> .env
echo GOOGLE_API_KEY="${{secrets.GOOGLE_API_KEY}}" >> .env
echo ANTHROPIC_API_KEY="${{secrets.ANTHROPIC_API_KEY}}" >> .env
echo REPLICATE_API_TOKEN="${{secrets.REPLICATE_API_TOKEN}}" >> .env
echo VOYAGE_API_KEY="${{secrets.VOYAGE_API_KEY}}" >> .env
echo "" >> .env
echo "## MongoDB-PROD (Azure CosmosDB for MongoDB) Connection String" >> .env
echo "# Had to multiply maxIdleTimeMS by 10 to handle" >> .env
echo "# urllib3.exceptions.ProtocolError: (\"Connection broken: ConnectionResetError(104, 'Connection reset by peer')\", ConnectionResetError(104, 'Connection reset by peer'))" >> .env
echo MONGODB_CONN_STRING="${{secrets.PANKB_PREPROD_MONGODB_CONN_STRING}}" >> .env
cat .env
docker compose up -d --build --force-recreate