fix
This commit is contained in:
@@ -40,25 +40,37 @@ jobs:
|
||||
npm run clean
|
||||
npm run build
|
||||
|
||||
- name: 部署到 Gitea Page 分支
|
||||
env:
|
||||
# 确保在仓库 Secrets 中已添加此私钥
|
||||
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_ed25519
|
||||
chmod 600 ~/.ssh/id_ed25519
|
||||
- name: 强制调试部署
|
||||
env:
|
||||
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||
run: |
|
||||
# 1. 验证私钥是否加载成功
|
||||
if [ -z "$SSH_PRIVATE_KEY" ]; then
|
||||
echo "错误: 仓库 Secrets 中的 SSH_PRIVATE_KEY 是空的!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ssh-keyscan git.biss.click >> ~/.ssh/known_hosts
|
||||
mkdir -p ~/.ssh
|
||||
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_ed25519
|
||||
chmod 600 ~/.ssh/id_ed25519
|
||||
|
||||
cd ./public
|
||||
git init
|
||||
git config user.name "${{ github.actor }}"
|
||||
git config user.email "${{ github.actor }}@noreply.gitea.com"
|
||||
git add .
|
||||
git commit -m "Deploy: ${{ github.event.head_commit.message }} [$(date +'%Y-%m-%d %H:%M:%S')]"
|
||||
# 2. 详细测试 SSH 连接 (不使用 quiet,强制显示结果)
|
||||
ssh-keyscan -p 22 git.biss.click >> ~/.ssh/known_hosts
|
||||
ssh -vT -i ~/.ssh/id_ed25519 git@git.biss.click || true
|
||||
|
||||
git push --force "git@git.biss.click:biss/blog.git" master:page
|
||||
# 3. 部署并移除 --quiet,打印所有 Git 原始报错
|
||||
cd ./public
|
||||
git init
|
||||
git config user.name "${{ github.actor }}"
|
||||
git config user.email "${{ github.actor }}@noreply.gitea.com"
|
||||
git add .
|
||||
git commit -m "Debug Deploy: $(date)"
|
||||
|
||||
# 开启环境变量调试输出
|
||||
export GIT_SSH_COMMAND="ssh -v -i ~/.ssh/id_ed25519 -o StrictHostKeyChecking=no"
|
||||
|
||||
# 推送时删除 --quiet
|
||||
git push --force -v "git@git.biss.click:biss/blog.git" master:pages
|
||||
|
||||
- name: 通知服务器 Hook
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user