Skip to content

Commit

Permalink
update deploy action step order
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmetozdursun committed Sep 25, 2024
1 parent 0411897 commit 7b21e86
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@ jobs:
cd ~ || exit 1
cd $TARGET_DIR || exit 1
# Export correct node binary and pm2 path
export PATH=/root/.nvm/versions/node/v21.6.2/bin:$PATH
# Install dependencies
if yarn install; then
echo "Dependencies installed successfully."
Expand All @@ -88,7 +85,7 @@ jobs:
# Job 2: Build and restart the server
build_and_restart:
restart:
runs-on: ubuntu-latest
needs: stop_server # Job 2 depends on Job 1 completing successfully
env:
Expand All @@ -110,6 +107,8 @@ jobs:
username: ${{ secrets.SERVER_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
# Export correct node binary and pm2 path
export PATH=/root/.nvm/versions/node/v21.6.2/bin:$PATH
# Start the app with pm2
if pm2 start yarn --name "serhatozdursun_website" -- start; then
echo "PM2 process 'serhatozdursun_website' started successfully."
Expand Down

0 comments on commit 7b21e86

Please sign in to comment.