-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (38 loc) · 1.27 KB
/
deploy_backend.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
name: Deploy to H100
on:
push:
branches: [ main ]
paths:
- 'backend/**'
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install sshpass
run: sudo apt-get install -y sshpass
- name: Deploy with rsync
env:
SSH_PASS: ${{ secrets.SSH_PASSWORD }}
run: |
sshpass -p "$SSH_PASS" rsync -avz --delete \
-e "ssh -o StrictHostKeyChecking=no" \
--exclude '.env' \
--exclude 'venv/' \
--exclude '__pycache__/' \
--exclude '*.pyc' \
--exclude 'server.log' \
./backend/ [email protected]:/home/ubuntu/backend/
- name: Run deployment script
env:
SSH_PASS: ${{ secrets.SSH_PASSWORD }}
GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }}
SECRET_KEY: ${{ secrets.SECRET_KEY }}
run: |
sshpass -p "$SSH_PASS" ssh -o StrictHostKeyChecking=no [email protected] 'cd /home/ubuntu/backend && \
export GROQ_API_KEY="${{ secrets.GROQ_API_KEY }}" && \
export SECRET_KEY="${{ secrets.SECRET_KEY }}" && \
source venv/bin/activate && \
pip install groq && \
bash deploy.sh'