Skip to content

Commit

Permalink
Create deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaSlui authored Jul 2, 2024
1 parent 65ebabe commit dd640cb
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Deploy to VPS

on:
release:
types: [published]

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE }}


- name: Deploy to VPS
run: |
ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USER }}@${{ secrets.SSH_IP }} << 'EOF'
cd pingernos
git pull origin Python
venv/bin/pip install -r requirements.txt
WATCH_MODE=$(pm2 jlist | jq -r '.[] | select(.name == "pingernos") | .pm2_env.watch')
if [[ "$WATCH_MODE" != "true" ]]; then
pm2 restart pingernos --watch
fi
EOF

0 comments on commit dd640cb

Please sign in to comment.