🤖 ci(docker): auto-build on push to main + fix root Dockerfile swag step (#94)
Co-authored-by: Gabriel Radureau <arcodange@gmail.com> Co-committed-by: Gabriel Radureau <arcodange@gmail.com>
This commit was merged in pull request #94.
This commit is contained in:
@@ -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