File tree Expand file tree Collapse file tree 3 files changed +66
-0
lines changed
Expand file tree Collapse file tree 3 files changed +66
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Build and release
2+
3+ on :
4+ push :
5+ branches :
6+ - " main"
7+ pull_request :
8+ branches :
9+ - " main"
10+
11+ env :
12+ REGISTRY : ghcr.io
13+ IMAGE_NAME : ${{ github.repository }}
14+
15+ jobs :
16+ build-and-push-image :
17+ runs-on : ubuntu-latest
18+ permissions :
19+ contents : read
20+ packages : write
21+
22+ steps :
23+ - name : Checkout repository
24+ uses : actions/checkout@v2
25+
26+ - name : Log in to the Container registry
27+ 28+ with :
29+ registry : ${{ env.REGISTRY }}
30+ username : ${{ github.actor }}
31+ password : ${{ secrets.GITHUB_TOKEN }}
32+
33+ - name : Extract metadata (tags, labels) for Docker
34+ id : meta
35+ 36+ with :
37+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
38+
39+ - name : Build and push Docker image
40+ 41+ with :
42+ context : .
43+ push : true
44+ tags : ${{ steps.meta.outputs.tags }}
45+ labels : ${{ steps.meta.outputs.labels }}
Original file line number Diff line number Diff line change 1+ # syntax=docker/dockerfile:1
2+ FROM golang:1.18-alpine as builder
3+
4+ # needed for github.com/mattn/go-sqlite3
5+ RUN apk add --no-cache gcc g++
6+
7+ WORKDIR /app
8+ COPY go.mod go.sum ./
9+ RUN go mod download
10+
11+ COPY internal ./internal
12+ COPY main.go ./
13+ RUN go build -o /backend
14+
15+ # Build final image
16+ FROM alpine:3.15.1
17+ WORKDIR /app
18+ COPY --from=builder /backend /app/backend
19+ ENTRYPOINT ["/app/backend" ]
Original file line number Diff line number Diff line change @@ -37,3 +37,5 @@ require (
3737 google.golang.org/protobuf v1.27.1 // indirect
3838 gopkg.in/yaml.v2 v2.4.0 // indirect
3939)
40+
41+ replace github.com/envelope-zero/backend/internal/routing => ./internal/routing
You can’t perform that action at this time.
0 commit comments