Skip to content

Commit 889fd0a

Browse files
Fix PM2 command not found in CI/CD by using full path and loading env in SSH steps
1 parent 8f098a9 commit 889fd0a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.github/workflows/nodejs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
key: ${{ secrets.SSH_PRIVATE_KEY }}
7272
port: 22
7373
script: |
74-
pm2 restart test_server
74+
/usr/local/bin/pm2 restart test_server # <-- Use full path here!
7575
7676
- name: Check PM2 logs
7777
uses: appleboy/[email protected]
@@ -81,7 +81,7 @@ jobs:
8181
key: ${{ secrets.SSH_PRIVATE_KEY }}
8282
port: 22
8383
script: |
84-
pm2 logs
84+
/usr/local/bin/pm2 logs test_server # <-- Use full path here!
8585
8686
- name: Check PM2 status
8787
uses: appleboy/[email protected]
@@ -91,7 +91,7 @@ jobs:
9191
key: ${{ secrets.SSH_PRIVATE_KEY }}
9292
port: 22
9393
script: |
94-
pm2 status
94+
/usr/local/bin/pm2 status test_server # <-- Use full path here!
9595
9696
- name: Check if the server is running
9797
uses: appleboy/[email protected]

0 commit comments

Comments
 (0)