i8
Some checks failed
CI / build (20.15.1) (push) Failing after 18m20s

This commit is contained in:
shanshanzhong 2025-09-25 11:24:18 -07:00
parent 94c515b2de
commit a38bb5d38a
2 changed files with 35 additions and 4 deletions

View File

@ -82,6 +82,9 @@ jobs:
echo "BUILD_TARGET=$BUILD_TARGET" >> $GITHUB_ENV
echo "Decided BUILD_TARGET=$BUILD_TARGET"
- name: Read version from package.json
run: echo "VERSION=$(jq -r .version package.json)" >> $GITHUB_ENV
- name: Build Admin (turbo via bun)
if: env.BUILD_TARGET == 'admin' || env.BUILD_TARGET == 'both'
run: bun run build --filter=ppanel-admin-web
@ -92,14 +95,19 @@ jobs:
- name: Build Docker (admin)
if: env.BUILD_TARGET == 'admin' || env.BUILD_TARGET == 'both'
run: make build-admin
run: docker build -f ./docker/ppanel-admin-web/Dockerfile -t ${{ env.DOCKER_REGISTRY }}/ppanel/ppanel-admin-web:${{ env.VERSION }} .
- name: Build Docker (user)
if: env.BUILD_TARGET == 'user' || env.BUILD_TARGET == 'both'
run: make build-user
run: docker build -f ./docker/ppanel-user-web/Dockerfile -t ${{ env.DOCKER_REGISTRY }}/ppanel/ppanel-user-web:${{ env.VERSION }} .
- name: Push Docker Images
run: make push
- name: Push Docker Image (admin)
if: env.BUILD_TARGET == 'admin' || env.BUILD_TARGET == 'both'
run: docker push ${{ env.DOCKER_REGISTRY }}/ppanel/ppanel-admin-web:${{ env.VERSION }}
- name: Push Docker Image (user)
if: env.BUILD_TARGET == 'user' || env.BUILD_TARGET == 'both'
run: docker push ${{ env.DOCKER_REGISTRY }}/ppanel/ppanel-user-web:${{ env.VERSION }}
- name: Notify success to Telegram
uses: chapvic/telegram-notify@master

View File

@ -59,6 +59,29 @@ push-user: ## Push the user image to the registry
@echo "Successfully pushed user image."
# ==============================================================================
# Run Targets
# ==============================================================================
.PHONY: ensure-version
ensure-version:
@if [ -z "${VERSION}" ] || [ "${VERSION}" = "null" ]; then \
echo "ERROR: 未检测到版本号。请安装 jq 并在 panel-web/package.json 中设置有效的 version 字段。"; \
echo "提示:可以运行 'make version' 查看当前版本值。"; \
exit 1; \
fi
.PHONY: admin-run
admin-run: ensure-version ## Run the admin container locally (binds to localhost:3000)
@echo "Running admin container from image ${ADMIN_IMAGE}:${VERSION} on http://localhost:3000 ..."
docker run --name ppanel-admin-web --rm -e NEXT_PUBLIC_API_URL=https://airoport.co -p 3000:3000 ${ADMIN_IMAGE}:${VERSION}
.PHONY: user-run
user-run: ensure-version ## Run the user container locally (binds to localhost:3001)
@echo "Running user container from image ${USER_IMAGE}:${VERSION} on http://localhost:3001 ..."
docker run --name ppanel-user-web --rm -p 3001:3000 ${USER_IMAGE}:${VERSION}
# ==============================================================================
# Other Targets
# ==============================================================================