-
-
Notifications
You must be signed in to change notification settings - Fork 3
49 lines (40 loc) · 1.54 KB
/
django.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
name: 🚀 Deploy Django
on:
push:
branches: [main]
jobs:
build-deploy:
name: 🎉 Build and Deploy
runs-on: ubuntu-latest
steps:
- name: 🚚 Get latest code
uses: actions/checkout@v2
- name: 🔨 Set up Python 3.9.12
uses: actions/setup-python@v2
with:
python-version: 3.9.12
- name: 🛠 Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: ▶ Run Tests
run: |
python manage.py test
env:
SECRET_KEY: ${{ secrets.BASE_KEY }}
SMTP_SERVER: ${{ secrets.SMTP_SERVER }}
SMTP_PASSWORD: ${{ secrets.SMTP_PASSWORD }}
NEW_AES_KEY: ${{ secrets.NEW_AES_KEY }}
DISCORD_CLIENT_SECRET: ${{ secrets.DISCORD_CLIENT_SECRET }}
- name: 🔃 Restart Server
run: |
mkdir tmp
touch tmp/restart.txt
- name: ☁ SFTP Deploy
uses: easingthemes/ssh-deploy@v2
env:
SSH_PRIVATE_KEY: ${{ secrets.SERVER_SSH_KEY }}
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
REMOTE_USER: ${{ secrets.REMOTE_USER }}
REMOTE_PORT: 21098 -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedKeyTypes=+ssh-rsa
TARGET: ${{ secrets.REMOTE_TARGET }}