Skip to content

Commit f5a1c92

Browse files
committed
ci: 修改构建 node 和 pnpm 版本
1 parent 586372f commit f5a1c92

2 files changed

Lines changed: 25 additions & 4 deletions

File tree

.github/workflows/frontend-ci-cd.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Frontend CI/CD
33
on:
44
push:
55
tags:
6-
- "v[0-9]+.[0-9]+.[0-9]+*"
6+
- 'v[0-9]+.[0-9]+.[0-9]+*'
77
paths:
88
- 'ui/**'
99
- '.github/workflows/frontend-ci-cd.yml'
@@ -29,12 +29,12 @@ jobs:
2929
- name: Set up Node.js
3030
uses: actions/setup-node@v4
3131
with:
32-
node-version: '20'
32+
node-version: '20.19.0'
3333

3434
- name: Set up pnpm
3535
uses: pnpm/action-setup@v2
3636
with:
37-
version: 8
37+
version: 10.12.1
3838

3939
- name: Get version
4040
id: get_version
@@ -130,4 +130,4 @@ jobs:
130130
${{ env.REGISTRY }}/frontend:${{ needs.build.outputs.version }}
131131
${{ env.REGISTRY }}/frontend:latest
132132
cache-from: type=gha
133-
cache-to: type=gha,mode=max
133+
cache-to: type=gha,mode=max

ui/Makefile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
PLATFORM=linux/amd64
2+
TAG=main
3+
REGISTRY=monkeycode
4+
5+
6+
# 构建前端代码
7+
build:
8+
pnpm run build
9+
10+
# 构建并加载到本地Docker
11+
image: build
12+
docker buildx build \
13+
-f .Dockerfile \
14+
--platform ${PLATFORM} \
15+
--tag ${REGISTRY}/frontend:${TAG} \
16+
--load \
17+
.
18+
19+
save: image
20+
docker save -o /tmp/monkeycode_frontend.tar monkeycode/frontend:main
21+

0 commit comments

Comments
 (0)