Skip to content

Commit 8c75710

Browse files
feat: automate server deployment with pm2 restart 🚀
1 parent a62764f commit 8c75710

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

.github/workflows/nodejs.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,18 @@ jobs:
2929
needs: build
3030
runs-on: ubuntu-latest
3131
steps:
32-
- name: Checkout code
33-
uses: actions/checkout@v3
32+
- name: Deploy to Server 🌐
33+
uses: appleboy/[email protected]
34+
with:
35+
host: ${{ secrets.SERVER_IP }}
36+
username: ${{ secrets.SERVER_USER }}
37+
key: ${{ secrets.SSH_PRIVATE_KEY }}
38+
port: 22
39+
script: |
40+
cd ~/CI-CD-Integration-IN-NodeJS
41+
git pull origin master
42+
npm install
43+
pm2 restart test_server
3444
3545
- name: Deploy to Server (Simulation)
3646
run: echo "Pretend we're deploying the app now!"

0 commit comments

Comments
 (0)