This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user