Skip to content

Commit e89e2fa

Browse files
committed
Use git reset --hard instead of checkout -f for deploy
1 parent 24b5d7a commit e89e2fa

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

.github/workflows/deploy-beta.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ jobs:
1919
cd ${{ secrets.BETA_PATH }}
2020
cp .env /tmp/beta.env 2>/dev/null; cp port.txt /tmp/beta.port.txt 2>/dev/null
2121
git fetch origin
22-
git checkout -f -B beta origin/beta
22+
git reset --hard origin/beta
23+
git checkout -B beta
2324
cp /tmp/beta.env .env 2>/dev/null; cp /tmp/beta.port.txt port.txt 2>/dev/null
2425
npm install
2526
pm2 restart beta

.github/workflows/deploy-main.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ jobs:
1919
cd ${{ secrets.MAIN_PATH }}
2020
cp .env /tmp/main.env 2>/dev/null; cp port.txt /tmp/main.port.txt 2>/dev/null
2121
git fetch origin
22-
git checkout -f -B main origin/main
22+
git reset --hard origin/main
23+
git checkout -B main
2324
cp /tmp/main.env .env 2>/dev/null; cp /tmp/main.port.txt port.txt 2>/dev/null
2425
npm install
2526
pm2 restart zerohost-dashboard

0 commit comments

Comments
 (0)