-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (54 loc) · 1.56 KB
/
deploy.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: Build and Deploy
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Setup Redis for use in testing
uses: shogo82148/actions-setup-redis@v1
with:
redis-version: '5.x'
- name: Redis ping
run: redis-cli ping
- name: Set up Python 3.6.9
uses: actions/setup-python@v1
with:
python-version: 3.6.9
- name: Install dependencies
run: |
python -m venv venv
venv/bin/pip install --upgrade pip
venv/bin/pip install -r requirements.txt
- name: Lint and test
run: |
venv/bin/flake8 . --exclude venv
venv/bin/pytest
- name: Deploy the build
id: deploy
uses: Pendect/[email protected]
env:
DEPLOY_KEY: ${{secrets.DEPLOY_KEY}}
with:
flags: '-avzr --delete'
options: ''
ssh_options: ''
src: 'decidel.ini default_config.py wsgi.py decidel requirements.txt'
dest: ${{ secrets.DEPLOY_DESTINATION }}
- name: Display status from deploy
run: echo "${{ steps.deploy.outputs.status }}"
- name: Restart the app
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USERNAME }}
key: ${{ secrets.DEPLOY_KEY }}
script: |
cd /var/app/decidel/
python3 -m venv venv
venv/bin/pip install --upgrade pip
venv/bin/pip install -r requirements.txt
sudo /bin/systemctl restart decidel.service