1 parent b014d57 commit 2829dbcCopy full SHA for 2829dbc
1 file changed
.github/workflows/deploy.yml
@@ -21,18 +21,13 @@ jobs:
21
22
DEPLOY_DIR=/opt/md2wechat
23
24
- # First-time setup: clone if not a git repo yet
+ # First-time setup: init git in existing directory
25
if [ ! -d "$DEPLOY_DIR/.git" ]; then
26
sudo mkdir -p "$DEPLOY_DIR"
27
sudo chown $USER:$USER "$DEPLOY_DIR"
28
- # Preserve .env if it exists
29
- if [ -f "$DEPLOY_DIR/.env" ]; then
30
- cp "$DEPLOY_DIR/.env" /tmp/.env.bak
31
- fi
32
- git clone git@github.com:sawyerbutton/md2wechat.git "$DEPLOY_DIR"
33
- if [ -f /tmp/.env.bak ]; then
34
- mv /tmp/.env.bak "$DEPLOY_DIR/.env"
35
+ cd "$DEPLOY_DIR"
+ git init
+ git remote add origin git@github.com:sawyerbutton/md2wechat.git
36
fi
37
38
cd "$DEPLOY_DIR"
0 commit comments