-
Notifications
You must be signed in to change notification settings - Fork 215
44 lines (41 loc) · 1.37 KB
/
cd.dev.yaml
File metadata and controls
44 lines (41 loc) · 1.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
name: Development Branch Deployment
on:
push:
branches: [dev]
paths-ignore:
- "README.md"
- ".github/workflows/**"
workflow_dispatch:
jobs:
on-success:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Archive application build
run: |
mkdir app
cp -r alembic api qa_tests scripts tests requirements.txt *.py alembic.ini app
tar -czf python-dev.tar.gz app
- name: Copy Artifacts to server
run: |
sshpass -p ${{ secrets.PASSWORD }} scp -o StrictHostKeyChecking=no python-dev.tar.gz ${{ secrets.USERNAME }}@${{ secrets.HOST }}:/tmp/python
rm -f python-dev.tar.gz
- name: Use SSH Action
uses: appleboy/ssh-action@v0.1.8
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
script: |
cd boilerplate/python/dev
tar -xzf /tmp/python/python-dev.tar.gz -C .
rm -f /tmp/python/python-dev.tar.gz
cp .env app/.env
source venv/bin/activate
cd app
pip install -r requirements.txt
alembic revision --autogenerate
alembic upgrade head
cd ..
pm2 restart dev-ecosystem.config.js || pm2 start dev-ecosystem.config.js