This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
name: ci
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [feat/dev]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
verify:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 检出代码
|
||||
env:
|
||||
GITEA_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
git init -q .
|
||||
git remote add origin "https://token:${GITEA_TOKEN}@git.sundynix.cn/${{ github.repository }}.git"
|
||||
git fetch -q --depth 1 origin "${{ github.ref }}"
|
||||
git checkout -q FETCH_HEAD
|
||||
|
||||
- name: 测试并构建后端与管理端
|
||||
run: docker build -f pets-be/Dockerfile -t "sundynix/pets-be:ci-${{ github.sha }}" pets-be
|
||||
@@ -24,6 +24,7 @@ RUN go mod download
|
||||
COPY . .
|
||||
# 用真实构建产物覆盖 embed 目录(internal/admin/embed.go 里 //go:embed all:dist)
|
||||
COPY --from=admin /app/dist ./internal/admin/dist
|
||||
RUN go test ./...
|
||||
RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /out/pets-be ./cmd/server
|
||||
|
||||
# ── 2. 运行镜像 ──
|
||||
|
||||
Reference in New Issue
Block a user