Skip to content

Commit

Permalink
feat: add CD to Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucerna00 committed May 18, 2024
1 parent 43e0d31 commit 4c7fa08
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/django.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,26 @@ jobs:
- name: Run Tests
run: |
python manage.py test
deploy:

needs: build
runs-on: ubuntu-22.04

steps:
- name: Connect EC2 ssh
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_PEM }}
script: |
sudo apt-get update
sudo apt-get -y upgrade
cd temp/UAM_KNU_backend
sudo lsof -t -i tcp:8000 | xargs kill -9
pip install -r requirements.txt
python3 manage.py makemigrations
python3 manage.py migrate
nohup python3 manage.py runserver 0:8000 &
exit 0

0 comments on commit 4c7fa08

Please sign in to comment.