From fadc8db9c7dc4c0b28b3f7dd22d2ebcf954241ac Mon Sep 17 00:00:00 2001 From: CI Bot Date: Sat, 18 Jul 2026 12:05:06 +0800 Subject: [PATCH] =?UTF-8?q?fix(ci):=20=E9=A2=84=E8=A7=88=E7=8E=AF=E5=A2=83?= =?UTF-8?q?rsync=E5=AE=89=E8=A3=85=E5=85=BC=E5=AE=B9Alpine=20runner?= =?UTF-8?q?=EF=BC=88apk=E6=9B=BF=E4=BB=A3apt-get=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit runtime-builder标签的runner是Alpine系统,没有apt-get, 导致openssh-client和rsync安装失败。改为自动检测包管理器 (apk/apt-get/yum),兼容多种runner环境。 --- .gitea/workflows/preview-cleanup.yml | 9 ++++++++- .gitea/workflows/preview-deploy.yml | 13 +++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/preview-cleanup.yml b/.gitea/workflows/preview-cleanup.yml index 20d50781b..41f1900ef 100644 --- a/.gitea/workflows/preview-cleanup.yml +++ b/.gitea/workflows/preview-cleanup.yml @@ -28,7 +28,14 @@ jobs: shell: sh run: | set -eu - apt-get update -qq && apt-get install -y -qq openssh-client >/dev/null 2>&1 + if command -v apk >/dev/null 2>&1; then + apk add --no-cache openssh-client >/dev/null 2>&1 + elif command -v apt-get >/dev/null 2>&1; then + apt-get update -qq && apt-get install -y -qq openssh-client >/dev/null 2>&1 + else + echo "ERROR: No package manager found" + exit 1 + fi echo "openssh-client installed" - name: Remove preview directory from server diff --git a/.gitea/workflows/preview-deploy.yml b/.gitea/workflows/preview-deploy.yml index b70bf45ba..28f4f5189 100644 --- a/.gitea/workflows/preview-deploy.yml +++ b/.gitea/workflows/preview-deploy.yml @@ -132,11 +132,20 @@ jobs: ls -la dist/ ' - - name: Install SSH client + - name: Install SSH client and rsync shell: sh run: | set -eu - apt-get update -qq && apt-get install -y -qq openssh-client rsync >/dev/null 2>&1 + if command -v apk >/dev/null 2>&1; then + apk add --no-cache openssh-client rsync >/dev/null 2>&1 + elif command -v apt-get >/dev/null 2>&1; then + apt-get update -qq && apt-get install -y -qq openssh-client rsync >/dev/null 2>&1 + elif command -v yum >/dev/null 2>&1; then + yum install -y openssh-clients rsync >/dev/null 2>&1 + else + echo "ERROR: No package manager found" + exit 1 + fi echo "openssh-client and rsync installed" - name: Deploy preview to server