正式版第一次提交(修复Action流问题5)
Some checks failed
Deploy to Remote Server / deploy (push) Has been cancelled
Some checks failed
Deploy to Remote Server / deploy (push) Has been cancelled
This commit is contained in:
parent
89c1835ac0
commit
e13591cdfa
|
|
@ -18,31 +18,36 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Manual checkout (方案四)
|
- name: Manual checkout with SSH
|
||||||
run: |
|
run: |
|
||||||
git config --global http.version HTTP/1.1
|
echo "=== 配置 SSH ==="
|
||||||
git config --global http.postBuffer 524288000
|
mkdir -p ~/.ssh
|
||||||
git config --global core.compression 0
|
chmod 700 ~/.ssh
|
||||||
|
|
||||||
# 如果配置了 SSH 密钥
|
# 添加 SSH 私钥
|
||||||
if [ -n "${{ secrets.SSH_PRIVATE_KEY }}" ]; then
|
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
|
||||||
mkdir -p ~/.ssh
|
chmod 600 ~/.ssh/id_rsa
|
||||||
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
|
|
||||||
|
|
||||||
git clone --depth 1 \
|
# 添加服务器公钥到 known_hosts
|
||||||
https://gitea.bot.leisuretimedock.top/R3944Realms/LTDV10.git \
|
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
|
temp_repo
|
||||||
|
|
||||||
|
echo "=== 移动文件 ==="
|
||||||
shopt -s dotglob
|
shopt -s dotglob
|
||||||
mv temp_repo/* . 2>/dev/null || true
|
mv temp_repo/* . 2>/dev/null || true
|
||||||
mv temp_repo/.[!.]* . 2>/dev/null || true
|
mv temp_repo/.[!.]* . 2>/dev/null || true
|
||||||
rm -rf temp_repo
|
rm -rf temp_repo
|
||||||
|
|
||||||
|
echo "=== 验证 ==="
|
||||||
ls -la
|
ls -la
|
||||||
|
|
||||||
- name: Set executable permissions
|
- name: Set executable permissions
|
||||||
run: |
|
run: |
|
||||||
echo "=== 设置文件执行权限 ==="
|
echo "=== 设置文件执行权限 ==="
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user