fix
This commit is contained in:
@@ -40,25 +40,37 @@ jobs:
|
|||||||
npm run clean
|
npm run clean
|
||||||
npm run build
|
npm run build
|
||||||
|
|
||||||
- name: 部署到 Gitea Page 分支
|
- name: 强制调试部署
|
||||||
env:
|
env:
|
||||||
# 确保在仓库 Secrets 中已添加此私钥
|
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
run: |
|
||||||
run: |
|
# 1. 验证私钥是否加载成功
|
||||||
mkdir -p ~/.ssh
|
if [ -z "$SSH_PRIVATE_KEY" ]; then
|
||||||
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_ed25519
|
echo "错误: 仓库 Secrets 中的 SSH_PRIVATE_KEY 是空的!"
|
||||||
chmod 600 ~/.ssh/id_ed25519
|
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
|
# 2. 详细测试 SSH 连接 (不使用 quiet,强制显示结果)
|
||||||
git init
|
ssh-keyscan -p 22 git.biss.click >> ~/.ssh/known_hosts
|
||||||
git config user.name "${{ github.actor }}"
|
ssh -vT -i ~/.ssh/id_ed25519 git@git.biss.click || true
|
||||||
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')]"
|
|
||||||
|
|
||||||
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
|
- name: 通知服务器 Hook
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
Reference in New Issue
Block a user