Compare commits

..

No commits in common. "394727ccdb58356bc750619a2b0eaf45ca1afd6c" and "f35eb484805431933307dff53eef566a2d8b1ce3" have entirely different histories.

View File

@ -179,19 +179,6 @@ jobs:
if: env.BUILD_TARGET == 'user' || env.BUILD_TARGET == 'both'
run: docker push ${{ env.DOCKER_REGISTRY }}/ppanel/ppanel-user-web:${{ env.VERSION }}
- name: Debug SSH variables
if: env.BUILD_TARGET == 'admin' || env.BUILD_TARGET == 'both'
run: |
echo "SSH_HOST: ${{ env.SSH_HOST }}"
echo "SSH_PORT: ${{ env.SSH_PORT }}"
echo "SSH_USER: ${{ env.SSH_USER }}"
echo "DOCKER_REGISTRY: ${{ env.DOCKER_REGISTRY }}"
echo "VERSION: ${{ env.VERSION }}"
if [ -z "${{ env.SSH_HOST }}" ]; then
echo "ERROR: SSH_HOST is empty!"
exit 1
fi
- name: Deploy Admin via SSH (docker run)
if: env.BUILD_TARGET == 'admin' || env.BUILD_TARGET == 'both'
uses: https://${{ vars.GIT_USERNAME }}:${{ vars.GIT_PASSWORD }}@${{ env.DOMAIN_URL }}/actions/ssh-action@v0.1.10
@ -205,48 +192,9 @@ jobs:
REG="${{ env.DOCKER_REGISTRY }}"
VERSION="${{ env.VERSION }}"
echo "Deploying admin: $REG/ppanel/ppanel-admin-web:$VERSION"
# 拉取新镜像
docker pull "$REG/ppanel/ppanel-admin-web:$VERSION" || true
# 优雅停止并移除容器
if docker ps -q -f name=ppanel-admin-web | grep -q .; then
echo "Stopping existing container..."
docker stop ppanel-admin-web || true
sleep 5
fi
# 移除容器(如果存在)
if docker ps -aq -f name=ppanel-admin-web | grep -q .; then
echo "Removing existing container..."
docker rm ppanel-admin-web || true
fi
# 启动新容器
echo "Starting new container..."
docker rm -f ppanel-admin-web || true
docker run -d --name ppanel-admin-web --restart=always -p 3000:3000 -e NEXT_PUBLIC_API_URL="https://api.airoport.co" "$REG/ppanel/ppanel-admin-web:$VERSION"
# 验证容器启动
sleep 3
if docker ps -q -f name=ppanel-admin-web | grep -q .; then
echo "Container started successfully"
else
echo "Failed to start container"
exit 1
fi
- name: Debug SSH variables (User)
if: env.BUILD_TARGET == 'user' || env.BUILD_TARGET == 'both'
run: |
echo "SSH_HOST: ${{ env.SSH_HOST }}"
echo "SSH_PORT: ${{ env.SSH_PORT }}"
echo "SSH_USER: ${{ env.SSH_USER }}"
echo "DOCKER_REGISTRY: ${{ env.DOCKER_REGISTRY }}"
echo "VERSION: ${{ env.VERSION }}"
if [ -z "${{ env.SSH_HOST }}" ]; then
echo "ERROR: SSH_HOST is empty!"
exit 1
fi
- name: Deploy User via SSH (docker run)
if: env.BUILD_TARGET == 'user' || env.BUILD_TARGET == 'both'
@ -261,35 +209,9 @@ jobs:
REG="${{ env.DOCKER_REGISTRY }}"
VERSION="${{ env.VERSION }}"
echo "Deploying user: $REG/ppanel/ppanel-user-web:$VERSION"
# 拉取新镜像
docker pull "$REG/ppanel/ppanel-user-web:$VERSION" || true
# 优雅停止并移除容器
if docker ps -q -f name=ppanel-user-web | grep -q .; then
echo "Stopping existing container..."
docker stop ppanel-user-web || true
sleep 5
fi
# 移除容器(如果存在)
if docker ps -aq -f name=ppanel-user-web | grep -q .; then
echo "Removing existing container..."
docker rm ppanel-user-web || true
fi
# 启动新容器
echo "Starting new container..."
docker rm -f ppanel-user-web || true
docker run -d --name ppanel-user-web --restart=always -p 3001:3000 -e NEXT_PUBLIC_API_URL="https://api.airoport.co" "$REG/ppanel/ppanel-user-web:$VERSION"
# 验证容器启动
sleep 3
if docker ps -q -f name=ppanel-user-web | grep -q .; then
echo "Container started successfully"
else
echo "Failed to start container"
exit 1
fi
- name: Notify success to Telegram
uses: chapvic/telegram-notify@master
@ -301,6 +223,7 @@ jobs:
title: ✅ 构建成功
message: "${{ gitea.repository }} 构建成功"
footer: "触发者: ${{ gitea.actor }}"
parse_mode: HTML
- name: Notify failure to Telegram
uses: chapvic/telegram-notify@master
@ -312,3 +235,4 @@ jobs:
title: ❌ 构建失败
message: "${{ gitea.repository }} 构建失败"
footer: "触发者: ${{ gitea.actor }}"
parse_mode: HTML