Skip to content

Commit fbdfe32

Browse files
committed
Use git fetch + checkout -B for robust deploy
1 parent 12a08e4 commit fbdfe32

2 files changed

Lines changed: 6 additions & 10 deletions

File tree

.github/workflows/deploy-beta.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ jobs:
1717
port: ${{ secrets.SSH_PORT || 22 }}
1818
script: |
1919
cd ${{ secrets.BETA_PATH }}
20-
git add -A
21-
git stash
22-
git pull origin beta
20+
git fetch origin
21+
git checkout -B beta origin/beta
2322
npm install
24-
pm2 stop beta
25-
pm2 start beta
23+
pm2 restart beta

.github/workflows/deploy-main.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ jobs:
1717
port: ${{ secrets.SSH_PORT || 22 }}
1818
script: |
1919
cd ${{ secrets.MAIN_PATH }}
20-
git add -A
21-
git stash
22-
git pull origin main
20+
git fetch origin
21+
git checkout -B main origin/main
2322
npm install
24-
pm2 stop zerohost-dashboard
25-
pm2 start zerohost-dashboard
23+
pm2 restart zerohost-dashboard

0 commit comments

Comments
 (0)