-
Notifications
You must be signed in to change notification settings - Fork 1
28 lines (26 loc) · 1.14 KB
/
python-app.yml
File metadata and controls
28 lines (26 loc) · 1.14 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
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Pull & Deploy
on:
push:
branches: [ master ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Deploy
uses: appleboy/ssh-action@v0.1.4
with:
host: ${{secrets.SSH_HOST}}
key: ${{secrets.SSH_KEY}}
username: ${{secrets.SSH_USERNAME}}
script: |
cd /home/django/retsinformation/retsinfo_app
sudo -u django rm retsinfo_app/settings/.env
sudo -u django git pull
sudo -u django .env/bin/python -c 'from django.core.management.utils import get_random_secret_key; print("SECRET_KEY=" + get_random_secret_key())' >> retsinfo_app/settings/.env
sudo -u django .env/bin/pip install -r requirements.txt
sudo -u django .env/bin/python manage.py collectstatic --noinput
sudo -u django .env/bin/python manage.py makemigrations
sudo -u django .env/bin/python manage.py migrate
systemctl restart gunicorn