-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (56 loc) · 1.66 KB
/
ci_cd.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
57
58
59
60
61
62
63
64
65
66
67
68
69
name: CI/CD
on: [push, pull_request]
# push:
# branches:
# - main
jobs:
ci:
name: Backend Continuous Integration
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Create and activate virtual environment
run: |
python -m venv venv
source venv/bin/activate
python3 -m pip install -e .
python3 -m pip install -e .[dev]
# - name: Run Tests
# run: |
# source venv/bin/activate
# pytest
cd:
name: Continuous Delivery
runs-on: ubuntu-latest
needs: ci
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: executing remote ssh commands using password
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
password: ${{ secrets.SSH_PASSCODE }}
port: ${{ secrets.SSH_PORT }}
script: |
cd /diskb/home/backend
git pull origin develop
source venv/bin/activate
alembic upgrade heads
./start_uspolis_back.sh >> /home/ubuntu/script_log.log 2>&1
- name: Notify Command Success
run: echo "Command executed on ${{ secrets.HOST }} successfully!"
# - name: Connect to USP Server Machine
# run: |
# ssh [email protected] -p 2222
# ${{ secrets.SSH_PASSCODE }}
# cd /diskb/home/backend
# source venv/bin/activate
# git pull
# alembic upgrade heads