fix: rsync not found, use scp instead
All checks were successful
Deploy Static Sites / deploy (push) Successful in 5s
All checks were successful
Deploy Static Sites / deploy (push) Successful in 5s
This commit is contained in:
parent
1ab9e67f21
commit
e79ac93902
@ -21,16 +21,24 @@ jobs:
|
||||
chmod 600 ~/.ssh/id_rsa
|
||||
ssh-keyscan -H 118.196.70.19 >> ~/.ssh/known_hosts 2>/dev/null
|
||||
|
||||
# 同步所有项目目录到服务器(排除 .gitea、k8s 等非项目目录)
|
||||
rsync -avz --delete \
|
||||
--exclude='.gitea/' \
|
||||
--exclude='.git/' \
|
||||
--exclude='k8s/' \
|
||||
--exclude='README.md' \
|
||||
./ root@118.196.70.19:/data/static-sites/
|
||||
# 先清空服务器目录,再上传项目文件
|
||||
ssh root@118.196.70.19 "rm -rf /data/static-sites/* && mkdir -p /data/static-sites"
|
||||
|
||||
# 找出所有项目目录并 scp 上传
|
||||
for dir in */; do
|
||||
case "$dir" in
|
||||
.gitea/|.git/|k8s/) continue ;;
|
||||
esac
|
||||
echo "上传 $dir ..."
|
||||
scp -r "$dir" root@118.196.70.19:/data/static-sites/
|
||||
done
|
||||
|
||||
echo "✓ 文件同步完成"
|
||||
|
||||
- name: Verify
|
||||
run: |
|
||||
ssh root@118.196.70.19 "ls -la /data/static-sites/"
|
||||
mkdir -p ~/.ssh
|
||||
printf '%s\n' '${{ secrets.INTERNAL_SERVER_SSH_KEY }}' > ~/.ssh/id_rsa
|
||||
chmod 600 ~/.ssh/id_rsa
|
||||
ssh-keyscan -H 118.196.70.19 >> ~/.ssh/known_hosts 2>/dev/null
|
||||
ssh root@118.196.70.19 "ls -laR /data/static-sites/"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user