fix: cicd-调整6
Some checks failed
JT808 CI/CD / build-and-deploy (push) Failing after 0s

This commit is contained in:
lzh
2025-12-12 16:12:38 +08:00
parent 19820f4ee1
commit d82c8b03d9

View File

@@ -9,10 +9,21 @@ jobs:
build-and-deploy:
runs-on: xw-runner
steps:
# 1. 检出代码
# 使用 Gitea 官方镜像 URL避免 Runner 无法访问 GitHub
- name: Checkout
uses: https://gitea.com/actions/checkout@v3
# 1. 手动检出代码 (零外部依赖,解决拉取 Action 慢的问题)
- name: Checkout (Native)
run: |
# 清理工作目录
ls -A1 | xargs rm -rf
# 使用 Gitea 提供的 Token 直接克隆
# 注意gitea.repository_clone_url 通常是 http://domain/user/repo.git
# 我们在 clone 命令中手动注入用户名和 token
CLONE_URL=$(echo "${{ gitea.repository_clone_url }}" | sed -e "s|://|://${{ gitea.actor }}:${{ gitea.token }}@|")
echo "Cloning from local Gitea..."
git clone --depth 1 "$CLONE_URL" .
git log -1 --format='%h - %s'
# 2. 登录镜像仓库 (如果有配置)
- name: Login to Docker Registry