feat(api): 添加版本信息接口并完善构建流程
部署开发环境 / deploy-dev (push) Successful in 1m22s

- 在api路由中添加/version接口用于显示程序版本信息
- 集成全局Version变量用于版本号管理
- 修改Dockerfile支持版本号注入构建参数
- 更新开发环境部署工作流添加版本信息构建
- 更新生产环境部署工作流添加版本信息构建
- 实现在版本接口中展示程序版本和Gin框架版本
This commit is contained in:
2026-04-30 22:06:21 +08:00
parent 6d379714cd
commit 28aec98414
5 changed files with 22 additions and 3 deletions
+5 -1
View File
@@ -15,9 +15,13 @@ WORKDIR /build
COPY . .
COPY --from=webBuilder /build/dist ./web/dist
ARG VERSION
RUN go env -w CGO_ENABLED=0 \
&& go mod tidy \
&& go build -o dypid
&& go build \
-ldflags="-s -w -X 'global.Version=$VERSION'" \
-o dypid
FROM alpine