From 035edaf3fe376bb4228e9a68b58e256097416f46 Mon Sep 17 00:00:00 2001 From: syadmin Date: Sat, 14 Nov 2026 12:15:24 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E9=95=9C=E5=83=8F=E6=B8=85=E7=90=86?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E4=BB=85=E9=99=90=E6=9C=AC=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E6=97=A7=20sha=20=E7=89=88=E6=9C=AC=EF=BC=88=E4=BF=9D=E7=95=99?= =?UTF-8?q?=E6=9C=80=E8=BF=91=205=20=E4=B8=AA=EF=BC=89=EF=BC=8C=E4=B8=8D?= =?UTF-8?q?=E5=86=8D=E4=BD=BF=E7=94=A8=E5=85=A8=E5=B1=80=20image=20prune?= =?UTF-8?q?=20=E4=BB=A5=E5=85=8D=E5=BD=B1=E5=93=8D=E5=85=B1=E4=BA=AB?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=99=A8=E4=B8=8A=E5=85=B6=E4=BB=96=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E7=9A=84=E6=82=AC=E7=A9=BA=E5=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/deploy-hxtesting.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/deploy-hxtesting.yml b/.gitea/workflows/deploy-hxtesting.yml index 8441b5a..585dae2 100644 --- a/.gitea/workflows/deploy-hxtesting.yml +++ b/.gitea/workflows/deploy-hxtesting.yml @@ -36,7 +36,11 @@ jobs: WITH_ANYDOC=0 bash scripts/build_images.sh -f docker tag wechatopenai/weknora-app:latest wechatopenai/weknora-app:sha-${GIT_SHA} docker tag wechatopenai/weknora-ui:latest wechatopenai/weknora-ui:sha-${GIT_SHA} - docker image prune -f --filter "until=168h" >/dev/null + # 仅清理本项目旧版本镜像(保留最近 5 个 sha-* 备回滚),不影响服务器上其他项目 + for repo in wechatopenai/weknora-app wechatopenai/weknora-ui; do + docker images --format '{{.Tag}}' "$repo" | grep '^sha-' | tail -n +6 \ + | xargs -r -I{} docker rmi "$repo:{}" >/dev/null 2>&1 || true + done - name: 部署(compose up) run: |