🤖 ci(docker): auto-build on push to main + fix root Dockerfile swag step #94

Merged
arcodange merged 1 commits from vibe/batch-pr-w1-docker-push-on-main into main 2026-05-06 07:06:11 +02:00
2 changed files with 19 additions and 1 deletions

View File

@@ -6,7 +6,6 @@
name: Docker Push name: Docker Push
on: on:
# Manual trigger for testing or production
workflow_dispatch: workflow_dispatch:
inputs: inputs:
ref: ref:
@@ -14,6 +13,18 @@ on:
required: false required: false
type: string type: string
default: '' default: ''
push:
branches:
- main
paths-ignore:
- 'README.md'
- 'AGENTS.md'
- 'CHANGELOG.md'
- 'AGENT_CHANGELOG.md'
- 'documentation/**'
- 'adr/**'
- 'chart/**'
- 'features/**'
# Environment variables # Environment variables
env: env:

View File

@@ -14,6 +14,13 @@ RUN go mod download
# Copy entire source code # Copy entire source code
COPY . . COPY . .
# Generate Swagger documentation if not already present
# (pkg/server/docs/ is gitignored ; the binary //go:embed depends on it)
RUN if [ ! -f pkg/server/docs/swagger.json ]; then \
go install github.com/swaggo/swag/cmd/swag@latest && \
cd pkg/server && go generate ; \
fi
# Build the server binary # Build the server binary
RUN go build -o app ./cmd/server RUN go build -o app ./cmd/server