Develop #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to EC2 on main | |
on: | |
pull_request: | |
branches: [ main ] | |
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 }} | |
password: ${{ secrets.AWS_EC2_PASSWORD }} | |
port: ${{ secrets.AWS_EC2_SSH_PORT }} | |
script: | | |
cd project/BE | |
git fetch origin | |
git pull origin main | |
sudo systemctl restart gunicorn | |
sudo systemctl restart celery | |
sudo systemctl restart celerybeat |