正式版第一次提交(修复Action流问题5)
Some checks failed
Deploy to Remote Server / deploy (push) Has been cancelled

This commit is contained in:
叁玖领域 2026-05-01 23:28:39 +08:00
parent 89c1835ac0
commit e13591cdfa

View File

@ -18,31 +18,36 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Manual checkout (方案四)
- name: Manual checkout with SSH
run: |
git config --global http.version HTTP/1.1
git config --global http.postBuffer 524288000
git config --global core.compression 0
echo "=== 配置 SSH ==="
mkdir -p ~/.ssh
chmod 700 ~/.ssh
# 如果配置了 SSH 密钥
if [ -n "${{ secrets.SSH_PRIVATE_KEY }}" ]; then
mkdir -p ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -p 22 gitea.bot.leisuretimedock.top >> ~/.ssh/known_hosts 2>/dev/null
fi
# 添加 SSH 私钥
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
git clone --depth 1 \
https://gitea.bot.leisuretimedock.top/R3944Realms/LTDV10.git \
# 添加服务器公钥到 known_hosts
ssh-keyscan -p 22 gitea.bot.leisuretimedock.top >> ~/.ssh/known_hosts 2>/dev/null
# 配置 Git 使用 SSH
git config --global url."git@gitea.bot.leisuretimedock.top:".insteadOf "https://gitea.bot.leisuretimedock.top/"
echo "=== 克隆仓库SSH 方式)==="
GIT_SSH_COMMAND="ssh -v" git clone --depth 1 \
git@gitea.bot.leisuretimedock.top:R3944Realms/LTDV10.git \
temp_repo
echo "=== 移动文件 ==="
shopt -s dotglob
mv temp_repo/* . 2>/dev/null || true
mv temp_repo/.[!.]* . 2>/dev/null || true
rm -rf temp_repo
echo "=== 验证 ==="
ls -la
- name: Set executable permissions
run: |
echo "=== 设置文件执行权限 ==="