Merge pull request #52 from supermandee/dev #20
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 (PROD) | |
on: | |
push: | |
branches: [ main ] | |
permissions: | |
contents: read | |
deployments: write | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
environment: | |
name: production | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Deploy to EC2 | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.HOST }} | |
username: ubuntu | |
key: ${{ secrets.SSH_KEY }} | |
script: | | |
cd /home/ubuntu/myspotipal | |
git pull origin main | |
source venv/bin/activate | |
pip install -r requirements.txt | |
sudo systemctl restart myspotipal.service | |
sudo systemctl restart nginx | |
sudo systemctl status myspotipal.service |