This commit is contained in:
@@ -10,9 +10,21 @@ jobs:
|
|||||||
K3S_HOST: ${{ secrets.K3S_HOST }}
|
K3S_HOST: ${{ secrets.K3S_HOST }}
|
||||||
APP_NAME: ${{ gitea.repo_name }}
|
APP_NAME: ${{ gitea.repo_name }}
|
||||||
steps:
|
steps:
|
||||||
- name: 拉取代码
|
- name: 拉取代码(Gitea官方源)
|
||||||
uses: actions/checkout@v4
|
uses: gitea/actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0 # 可选:拉取完整历史,加速后续操作
|
||||||
|
timeout-minutes: 10 # 增加超时,避免拉取中断
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
- 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
|
- name: SSH部署K3s
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ~/.ssh
|
mkdir -p ~/.ssh
|
||||||
|
|||||||
Reference in New Issue
Block a user