Skip to content

Commit ed22c9e

Browse files
authored
Create deploy.yml
1 parent 0151d8a commit ed22c9e

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Deploy via SSH
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repo
14+
uses: actions/checkout@v4
15+
16+
- name: Set up SSH
17+
uses: webfactory/ssh-agent@v0.9.0
18+
with:
19+
ssh-private-key: ${{ secrets.SSH_KEY }}
20+
21+
- name: Connect and Deploy
22+
run: |
23+
ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }} << 'EOF'
24+
cd ${{ secrets.PROJECT_PATH }}
25+
git pull origin main
26+
pm2 restart 3
27+
EOF

0 commit comments

Comments
 (0)