File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7575 run : |
7676 ssh playground-umc-7th '
7777 cd /home/ubuntu/UMCIGNAL-server
78- npm ci # clean install, 기존 node_modules는 삭제하고 다시 설치
78+ npm install
7979 '
8080
8181 - name : Create or Update .env file
@@ -99,36 +99,26 @@ jobs:
9999 JWT_SECRET=${{ secrets.JWT_SECRET }}
100100 EOF'
101101
102- - name : Fix npm permissions and install pm2
103- run : |
104- ssh playground-umc-7th '
105- mkdir -p ~/.npm-global
106- npm config set prefix ~/.npm-global
107- echo "export PATH=$PATH:~/.npm-global/bin" >> ~/.bashrc
108- source ~/.bashrc
109- npm install -g pm2
110- '
111-
112- - name : Restart Application with pm2
102+ - name : Restart Application
113103 run : |
114104 ssh playground-umc-7th '
115105 cd /home/ubuntu/UMCIGNAL-server
116106 if pgrep node; then
117- pm2 stop umcignal-server || echo "No process found to stop"
107+ pkill node
118108 sleep 5
119109 fi
120- pm2 start npm --name "umcignal-server" -- run dev || (echo "❌ pm2 failed to start the app"; exit 1)
110+ nohup npm run dev > app.log 2> app.error.log &
121111 '
122112
123- - name : Check if Application is Running with pm2
113+ - name : Check if Application is Running
124114 run : |
125115 ssh playground-umc-7th '
126116 sleep 10
127- if pm2 list | grep "umcignal-server" | grep -q "online" ; then
117+ if pgrep -x "node" > /dev/null ; then
128118 echo "✅ Application is running."
129119 else
130120 echo "❌ Application failed to start."
131- pm2 logs umcignal-server
121+ cat app.error.log
132122 exit 1
133123 fi
134124 '
You can’t perform that action at this time.
0 commit comments