Skip to content

Merge pull request #126 from cau-likelion-org/refactoring #200

Merge pull request #126 from cau-likelion-org/refactoring

Merge pull request #126 from cau-likelion-org/refactoring #200

Workflow file for this run

name: Django EC2 Deploy
on:
push:
branches: [main]
jobs:
deploy:
name: "Django CD"
runs-on: ubuntu-20.04
steps:
- name: EC2 ssh connection test
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_PEM }}
command_timeout: 3m
script: |
sudo apt-get update
sudo apt-get -y upgrade
cd cau-likelion-django
source venv/bin/activate
git pull origin main
sudo lsof -t -i tcp:8000 | xargs kill -9
pip install -r requirements.txt
python manage.py makemigrations
python manage.py migrate
nohup gunicorn --bind 0.0.0.0:8000 config.wsgi > nohup.out 2> nohup.err < /dev/null &
exit 0