-
Notifications
You must be signed in to change notification settings - Fork 7
33 lines (31 loc) · 978 Bytes
/
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
name: Deploy to Server
on:
pull_request:
# Change to merge when implemented (still beta)
types: [closed]
branches:
- master
jobs:
build:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: executing remote ssh commands using key
uses: appleboy/[email protected]
if: github.event.pull_request.merged == true
with:
host: ${{ secrets.host }}
username: ${{ secrets.user }}
key: ${{ secrets.id }}
port: ${{ secrets.port }}
script: |
cd ${{ secrets.deploy_dir }}
. venv-prod/bin/activate
cd website
git pull
python -m pip install --upgrade pip
pip install --upgrade --force-reinstall -r prod_requirements.txt
python manage.py migrate
python manage.py collectstatic --noinput
python manage.py compilemessages
echo "${{ secrets.dingseboms_password }}" | sudo -S systemctl restart gunicorn