Skip to content

Commit

Permalink
Steps during deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
alouradou committed Feb 18, 2024
1 parent 6b55d90 commit 0bbb2a9
Showing 1 changed file with 25 additions and 5 deletions.
30 changes: 25 additions & 5 deletions .github/workflows/auto-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
needs: build

steps:
- name: SSH to server and deploy
- name: Checkout Repository
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_HOST }}
Expand All @@ -44,16 +44,36 @@ jobs:
port: ${{ secrets.SERVER_PORT }}
script: |
cd serenadoit
python -m venv serenadoit .
source serenadoit/bin/activate
pip install -r requirements.txt
git stash
git pull origin master
git stash pop
source serenadoit/bin/activate
rm -rf ~/node/static/styles/ ~/node/static/scripts/ ~/node/static/images/
cp -r ./static ~/node/
- name: Install dependencies and restart server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.SERVER_SSH_KEY }}
port: ${{ secrets.SERVER_PORT }}
script: |
cd serenadoit
python -m venv serenadoit .
source serenadoit/bin/activate
pip install -r requirements.txt
kill $(ps aux | grep "^${{ secrets.SERVER_USERNAME }}" | grep '[g]unicorn' | awk '{print $2}') || true
- name: SSH to server and deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.SERVER_SSH_KEY }}
port: ${{ secrets.SERVER_PORT }}
script: |
cd serenadoit
source serenadoit/bin/activate
gunicorn -w 4 -b 0.0.0.0:10410 run_prod:app --error-logfile logs/error.log --access-logfile logs/access.log -D
- name: Check deployment
Expand Down

0 comments on commit 0bbb2a9

Please sign in to comment.