ci(docker): 更新工作流配置和服务名称
Some checks failed
Build docker and publish / build (20.15.1) (push) Failing after 29s
Some checks failed
Build docker and publish / build (20.15.1) (push) Failing after 29s
更新TG_CHAT_ID为正确值并将服务名称从ppanel改为ario 添加等待apt/dpkg锁释放的逻辑,防止构建时冲突 修复docker构建命令中的参数错误并添加多标签支持
This commit is contained in:
parent
6cee877922
commit
68c3afb137
@ -21,10 +21,10 @@ env:
|
||||
SSH_PASSWORD: ${{ vars.SSH_PASSWORD }}
|
||||
# TG通知
|
||||
TG_BOT_TOKEN: 8114337882:AAHkEx03HSu7RxN4IHBJJEnsK9aPPzNLIk0
|
||||
TG_CHAT_ID: "-4940243803111111"
|
||||
TG_CHAT_ID: "-4940243803111"
|
||||
# Go构建变量
|
||||
SERVICE: ppanel
|
||||
SERVICE_STYLE: ppanel
|
||||
SERVICE: ario
|
||||
SERVICE_STYLE: ario
|
||||
VERSION: ${{ github.sha }}
|
||||
BUILDTIME: ${{ github.event.head_commit.timestamp }}
|
||||
GOARCH: amd64
|
||||
@ -68,7 +68,18 @@ jobs:
|
||||
run: |
|
||||
set -e
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
>/dev/null 2>&1; then
|
||||
echo "等待 apt/dpkg 锁释放 (unattended-upgrades)..."
|
||||
# 等待最多 300 秒让 unattended-upgrades/apt/dpkg 锁释放
|
||||
end=$((SECONDS+300))
|
||||
while true; do
|
||||
LOCKS_BUSY=0
|
||||
# 如果 unattended-upgrades 正在运行,标记为忙碌
|
||||
if pgrep -x unattended-upgrades >/dev/null 2>&1; then LOCKS_BUSY=1; fi
|
||||
# 如果 fuser 存在,检查常见的锁文件
|
||||
if command -v fuser >/dev/null 2>&1; then
|
||||
if fuser /var/lib/dpkg/lock >/dev/null 2>&1 \
|
||||
|| fuser /var/lib/dpkg/lock-frontend >/dev/null 2>&1 \
|
||||
|| fuser /var/lib/apt/lists/lock >/dev/null 2>&1; then
|
||||
LOCKS_BUSY=1
|
||||
fi
|
||||
fi
|
||||
@ -98,8 +109,11 @@ jobs:
|
||||
# 构建镜像,同时打上版本和分支两个标签
|
||||
docker build -f Dockerfile \
|
||||
--platform linux/amd64 \
|
||||
--builI}} \
|
||||
-t ${{ env.REPO }}:${{ env.VERSION }} FFIX }} \
|
||||
--build-arg TARGETARCH=amd64 \
|
||||
--build-arg VERSION=${{ env.VERSION }} \
|
||||
--build-arg BUILDTIME=${{ env.BUILDTIME }} \
|
||||
-t ${{ env.REPO }}:${{ env.VERSION }} \
|
||||
-t ${{ env.REPO }}:${{ env.DOCKER_TAG_SUFFIX }} \
|
||||
.
|
||||
|
||||
echo "推送版本标签镜像: ${{ env.REPO }}:${{ env.VERSION }}"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user