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
|
chmod 600 ~/.ssh/id_rsa
|
||||||
ssh-keyscan -H 118.196.70.19 >> ~/.ssh/known_hosts 2>/dev/null
|
ssh-keyscan -H 118.196.70.19 >> ~/.ssh/known_hosts 2>/dev/null
|
||||||
|
|
||||||
# 同步所有项目目录到服务器(排除 .gitea、k8s 等非项目目录)
|
# 先清空服务器目录,再上传项目文件
|
||||||
rsync -avz --delete \
|
ssh root@118.196.70.19 "rm -rf /data/static-sites/* && mkdir -p /data/static-sites"
|
||||||
--exclude='.gitea/' \
|
|
||||||
--exclude='.git/' \
|
# 找出所有项目目录并 scp 上传
|
||||||
--exclude='k8s/' \
|
for dir in */; do
|
||||||
--exclude='README.md' \
|
case "$dir" in
|
||||||
./ root@118.196.70.19:/data/static-sites/
|
.gitea/|.git/|k8s/) continue ;;
|
||||||
|
esac
|
||||||
|
echo "上传 $dir ..."
|
||||||
|
scp -r "$dir" root@118.196.70.19:/data/static-sites/
|
||||||
|
done
|
||||||
|
|
||||||
echo "✓ 文件同步完成"
|
echo "✓ 文件同步完成"
|
||||||
|
|
||||||
- name: Verify
|
- name: Verify
|
||||||
run: |
|
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