File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed
Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Docker Build
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+
8+ jobs :
9+ build :
10+ runs-on : ubuntu-latest
11+ steps :
12+ - name : Checkout code
13+ uses : actions/checkout@v4
14+
15+ - name : Set up Docker Buildx
16+ uses : docker/setup-buildx-action@v3
17+
18+ - name : Build Docker image
19+ uses : docker/build-push-action@v5
20+ with :
21+ context : .
22+ push : false
23+ tags : transaction-latency:latest
24+ cache-from : type=gha
25+ cache-to : type=gha,mode=max
Original file line number Diff line number Diff line change 1+ FROM golang:1.24-alpine AS builder
2+ WORKDIR /app
3+ COPY go.mod go.sum ./
4+ RUN go mod download
5+ COPY . .
6+ RUN CGO_ENABLED=0 GOOS=linux go build -o main .
7+
8+ FROM alpine:latest
9+ WORKDIR /app
10+ COPY --from=builder /app/main .
11+ CMD ["./main" ]
You can’t perform that action at this time.
0 commit comments