This commit is contained in:
shanshanzhong 2025-09-25 03:12:23 -07:00
parent 22f5197417
commit 109e5ec119

View File

@ -1,74 +1,29 @@
name: 发布 Web 镜像
run-name: 构建并发布 Web Docker 镜像
name: CI
on:
workflow_dispatch:
push:
branches:
- cicd
paths:
- "apps/**"
- "packages/**"
- "package.json"
- "turbo.json"
- ".gitea/workflows/docker.yml"
- "docker/**/Dockerfile"
pull_request:
types: [opened, synchronize, reopened]
paths:
- "apps/**"
- "packages/**"
- "package.json"
- "turbo.json"
- ".gitea/workflows/docker.yml"
- "docker/**/Dockerfile"
branches:
- cicd
env:
REGISTRY_URL: registry.kxsw.us
ADMIN_IMAGE_NAME: ppanel/ppanel-admin-web
USER_IMAGE_NAME: ppanel/ppanel-user-web
REPO: ${{ vars.REPO }}
jobs:
publish:
name: 发布 Web 镜像
build:
runs-on: ppanel-web
strategy:
matrix:
# 只有node支持版本号别名
node: ['20.15.1']
steps:
- name: 检出代码
uses: actions/checkout@v4
- name: Checkout code
uses: https://gitea.cn/actions/checkout@v4
- name: 从 package.json 提取版本
id: version
run: echo "VERSION=$(jq -r .version package.json)" >> $GITEA_OUTPUT
- name: 设置 QEMU
uses: docker/setup-qemu-action@v3
- name: 设置 Docker Buildx
uses: docker/setup-buildx-action@v3
- name: 登录 Docker Registry
uses: docker/login-action@v3
- name: Set up Node.js
uses: https://github.com/pnpm/action-setup@v4
with:
registry: ${{ env.REGISTRY_URL }}
- name: 构建并推送 ppanel-admin-web Docker 镜像
uses: docker/build-push-action@v6
with:
context: .
file: ./docker/ppanel-admin-web/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ env.REGISTRY_URL }}/${{ env.ADMIN_IMAGE_NAME }}:latest
${{ env.REGISTRY_URL }}/${{ env.ADMIN_IMAGE_NAME }}:${{ steps.version.outputs.VERSION }}
- name: 构建并推送 ppanel-user-web Docker 镜像
uses: docker/build-push-action@v6
with:
context: .
file: ./docker/ppanel-user-web/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ env.REGISTRY_URL }}/${{ env.USER_IMAGE_NAME }}:latest
${{ env.REGISTRY_URL }}/${{ env.USER_IMAGE_NAME }}:${{ steps.version.outputs.VERSION }}
version: 9.15.9
run_install: false