Skip to content

Update main.yml

Update main.yml #2

Workflow file for this run

name: Deploy to EC2 on develop
on:
push:
branches: [ develop ]
jobs:
deploy:
name: deploy
runs-on: ubuntu-latest
steps:
- name: Run SSH Connection and Pull
uses: appleboy/[email protected]
with:
host: ${{ secrets.AWS_EC2_HOST }}
username: ${{ secrets.AWS_EC2_USERNAME }}
key: ${{ secrets.AWS_EC2_PASSWORD }}
port: ${{ secrets.AWS_EC2_SSH_PORT }}
script: |
cd project/BE
source venv/bin/activate
git fetch origin
git pull origin develop
pip install -r requirements.txt
cd wtnt
python3.11 manage.py makemigrations
python3.11 manage.py migrate
sudo systemctl restart gunicorn
sudo systemctl restart celery
sudo systemctl restart celerybeat