Skip to content

Commit dd640cb

Browse files
authored
Create deploy.yml
1 parent 65ebabe commit dd640cb

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Deploy to VPS
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v2
14+
15+
- name: Set up SSH
16+
uses: webfactory/ssh-agent@v0.5.4
17+
with:
18+
ssh-private-key: ${{ secrets.SSH_PRIVATE }}
19+
20+
21+
- name: Deploy to VPS
22+
run: |
23+
ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USER }}@${{ secrets.SSH_IP }} << 'EOF'
24+
cd pingernos
25+
git pull origin Python
26+
venv/bin/pip install -r requirements.txt
27+
WATCH_MODE=$(pm2 jlist | jq -r '.[] | select(.name == "pingernos") | .pm2_env.watch')
28+
if [[ "$WATCH_MODE" != "true" ]]; then
29+
pm2 restart pingernos --watch
30+
fi
31+
EOF

0 commit comments

Comments
 (0)