Skip to content

Commit fbd71b4

Browse files
committed
fix: 使用git reset --hard强制同步代码
- 替换git checkout为git reset --hard - 强制丢弃服务器上的所有本地更改 - 解决web/dist和web/node_modules冲突问题
1 parent b589dca commit fbd71b4

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

.github/workflows/deploy.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,9 @@ jobs:
7575
script: |
7676
cd /opt/TinyFlow
7777
78-
# 清理前端构建产物和依赖(避免 git checkout 冲突)
79-
rm -rf web/dist web/node_modules
80-
81-
# 拉取最新代码
78+
# 拉取最新代码并强制丢弃本地更改
8279
git fetch origin
83-
git checkout origin/$(git symbolic-ref --short HEAD)
80+
git reset --hard origin/$(git symbolic-ref --short HEAD)
8481
8582
# 更新 systemd 配置文件中的环境变量
8683
sudo sed -i "s|Environment=\"APP_DOMAIN=.*\"|Environment=\"APP_DOMAIN=$APP_DOMAIN\"|g" /etc/systemd/system/tinyflow.service

0 commit comments

Comments
 (0)