File tree Expand file tree Collapse file tree 2 files changed +32
-32
lines changed
Expand file tree Collapse file tree 2 files changed +32
-32
lines changed Original file line number Diff line number Diff line change 1+ name: Deploy to server
2+
3+ on:
4+ push:
5+ branches:
6+ - master # Trigger the workflow on push or pull request to the master branch
7+
8+ jobs:
9+ deploy:
10+ runs-on: ubuntu-latest
11+
12+ steps:
13+ - name: Checkout code
14+ uses: actions/checkout@v2
15+
16+ - name: Execute remote ssh commands to deploy
17+ uses: appleboy/ssh-action@master
18+ with:
19+ host: ${{ secrets.SERVER_HOST }}
20+ username: ${{ secrets.SERVER_USERNAME }}
21+ key: ${{ secrets.SSH_KEY }}
22+ script: |
23+ cd LinkedinAI
24+ git reset --hard
25+ git pull
26+ sed -i "s/SECRET_KEY = .*/SECRET_KEY = '${{ secrets.SECRET_KEY }}'/g" LinkedInAi/settings.py
27+ sed -i "s/DEBUG = .*/DEBUG = False/g" LinkedInAi/settings.py
28+ sed -i "s/ALLOWED_HOSTS = .*/ALLOWED_HOSTS = ['linkedinai.pratikpathak.com']/g" LinkedInAi/settings.py
29+ .venv/bin/python manage.py makemigrations # create new migrations based on the changes you made to your models
30+ .venv/bin/python manage.py migrate # apply and unapply migrations
31+ .venv/bin/python manage.py collectstatic --noinput
32+ sudo systemctl restart django
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments