-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (41 loc) · 972 Bytes
/
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
name: Netflix API CD
on:
push:
branches: [master]
jobs:
test:
services:
postgres:
image: postgres:9.6
env:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
runs-on: ubuntu-latest
env:
DJANGO_SETTINGS_MODULE: netflix.settings
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install Requirements
run: pip install -r requirements.txt
- name: Run tests
run: pytest
deploy:
runs-on: ubuntu-latest
needs: test
steps:
- name: executing remote ssh commands using password
uses: appleboy/ssh-action@master
with:
host: YOUR_HOST
username: root
key: ${{ secrets.KEY }}
script: |
cd netflix/
git pull
systemctl restart gunicorn.service