From f5a1c92cd84a85a3d91ed281b58e5650fba68ab5 Mon Sep 17 00:00:00 2001 From: Gavan <994259213@qq.com> Date: Mon, 14 Jul 2025 15:07:50 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E4=BF=AE=E6=94=B9=E6=9E=84=E5=BB=BA=20no?= =?UTF-8?q?de=20=E5=92=8C=20pnpm=20=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/frontend-ci-cd.yml | 8 ++++---- ui/Makefile | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 ui/Makefile diff --git a/.github/workflows/frontend-ci-cd.yml b/.github/workflows/frontend-ci-cd.yml index 3980766..e94c03b 100644 --- a/.github/workflows/frontend-ci-cd.yml +++ b/.github/workflows/frontend-ci-cd.yml @@ -3,7 +3,7 @@ name: Frontend CI/CD on: push: tags: - - "v[0-9]+.[0-9]+.[0-9]+*" + - 'v[0-9]+.[0-9]+.[0-9]+*' paths: - 'ui/**' - '.github/workflows/frontend-ci-cd.yml' @@ -29,12 +29,12 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v4 with: - node-version: '20' + node-version: '20.19.0' - name: Set up pnpm uses: pnpm/action-setup@v2 with: - version: 8 + version: 10.12.1 - name: Get version id: get_version @@ -130,4 +130,4 @@ jobs: ${{ env.REGISTRY }}/frontend:${{ needs.build.outputs.version }} ${{ env.REGISTRY }}/frontend:latest cache-from: type=gha - cache-to: type=gha,mode=max \ No newline at end of file + cache-to: type=gha,mode=max diff --git a/ui/Makefile b/ui/Makefile new file mode 100644 index 0000000..59557ef --- /dev/null +++ b/ui/Makefile @@ -0,0 +1,21 @@ +PLATFORM=linux/amd64 +TAG=main +REGISTRY=monkeycode + + +# 构建前端代码 +build: + pnpm run build + +# 构建并加载到本地Docker +image: build + docker buildx build \ + -f .Dockerfile \ + --platform ${PLATFORM} \ + --tag ${REGISTRY}/frontend:${TAG} \ + --load \ + . + +save: image + docker save -o /tmp/monkeycode_frontend.tar monkeycode/frontend:main + \ No newline at end of file