This commit is contained in:
@@ -10,8 +10,25 @@ jobs:
|
||||
K3S_HOST: ${{ secrets.K3S_HOST }}
|
||||
APP_NAME: ${{ gitea.repo_name }}
|
||||
steps:
|
||||
- name: 拉取代码
|
||||
uses: actions/checkout@v4
|
||||
# ========== 核心修改:替换checkout源,避开GitHub ==========
|
||||
- name: 拉取代码(Gitea官方源)
|
||||
uses: gitea/actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0 # 可选:拉取完整历史,加速后续操作
|
||||
timeout-minutes: 10 # 增加超时,避免拉取中断
|
||||
|
||||
# 1. 初始化 Docker Buildx(原内容不变)
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
# 3. 构建+推送(原内容不变)
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ env.REGISTRY }}/${{ env.APP_NAME }}:${{ gitea.sha }}
|
||||
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.APP_NAME }}:buildcache
|
||||
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.APP_NAME }}:buildcache,mode=max
|
||||
- name: SSH部署K3s
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
|
||||
Reference in New Issue
Block a user