File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -71,17 +71,19 @@ jobs:
71
71
key : ${{ secrets.SSH_PRIVATE_KEY }}
72
72
port : 22
73
73
script : |
74
- cd /usr/local/bin && pm2 restart test_server # <-- Use full path here!
74
+ export PATH=$PATH:/usr/local/bin
75
+ pm2 restart test_server
75
76
76
- - name : Check PM2 logs
77
+ - name : Check PM2 logs (safe and short)
77
78
uses : appleboy/ssh-action@v1.0.0
78
79
with :
79
80
host : ${{ secrets.SERVER_IP }}
80
81
username : ${{ secrets.SERVER_USER }}
81
82
key : ${{ secrets.SSH_PRIVATE_KEY }}
82
83
port : 22
83
84
script : |
84
- cd /usr/local/bin && pm2 logs test_server # <-- Use full path here!
85
+ export PATH=$PATH:/usr/local/bin
86
+ pm2 logs test_server --lines 20 --nostream
85
87
86
88
- name : Check PM2 status
87
89
uses : appleboy/ssh-action@v1.0.0
91
93
key : ${{ secrets.SSH_PRIVATE_KEY }}
92
94
port : 22
93
95
script : |
94
- cd /usr/local/bin && pm2 status test_server # <-- Use full path here!
96
+ export PATH=$PATH:/usr/local/bin
97
+ pm2 status test_server
95
98
96
99
- name : Check if the server is running
97
100
uses : appleboy/ssh-action@v1.0.0
@@ -101,4 +104,4 @@ jobs:
101
104
key : ${{ secrets.SSH_PRIVATE_KEY }}
102
105
port : 22
103
106
script : |
104
- curl -I http://localhost:3000
107
+ curl -I http://localhost:3000 || exit 1
You can’t perform that action at this time.
0 commit comments