🤖 ci(docker): auto-build on push to main + fix root Dockerfile swag step
Enable Docker image build on every push to main (paths-ignore for docs-only changes mirrors webapp pattern). Fix root Dockerfile (shipped by #89) which was missing the swag init step required for //go:embed of swagger.json (gitignored). Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
@@ -6,7 +6,6 @@
|
||||
name: Docker Push
|
||||
|
||||
on:
|
||||
# Manual trigger for testing or production
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
ref:
|
||||
@@ -14,6 +13,18 @@ on:
|
||||
required: false
|
||||
type: string
|
||||
default: ''
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths-ignore:
|
||||
- 'README.md'
|
||||
- 'AGENTS.md'
|
||||
- 'CHANGELOG.md'
|
||||
- 'AGENT_CHANGELOG.md'
|
||||
- 'documentation/**'
|
||||
- 'adr/**'
|
||||
- 'chart/**'
|
||||
- 'features/**'
|
||||
|
||||
# Environment variables
|
||||
env:
|
||||
|
||||
@@ -14,6 +14,13 @@ RUN go mod download
|
||||
# Copy entire source code
|
||||
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
|
||||
RUN go build -o app ./cmd/server
|
||||
|
||||
|
||||
Reference in New Issue
Block a user