File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Build and Push Docker Image
2+
3+ on :
4+ push :
5+ branches : [ rj-docker-build ]
6+ pull_request :
7+ branches : [ main ]
8+
9+ jobs :
10+ build-and-push :
11+ runs-on : ubuntu-latest
12+ steps :
13+ - name : Checkout code
14+ uses : actions/checkout@v4
15+
16+ - name : Set up Docker Buildx
17+ uses : docker/setup-buildx-action@v3
18+
19+ - name : Login to DockerHub
20+ uses : docker/login-action@v3
21+ with :
22+ username : ${{ secrets.DOCKERHUB_USERNAME }}
23+ password : ${{ secrets.DOCKERHUB_TOKEN }}
24+
25+ - name : Build and push
26+ uses : docker/build-push-action@v5
27+ with :
28+ context : .
29+ push : true
30+ tags : audius/api:latest
31+ cache-from : type=registry,ref=audius/api:buildcache
32+ cache-to : type=registry,ref=audius/api:buildcache,mode=max
Original file line number Diff line number Diff line change 1+ FROM golang:1.22-alpine AS builder
2+
3+ WORKDIR /app
4+
5+ COPY go.mod go.sum ./
6+
7+ RUN go mod download
8+
9+ COPY . .
10+
11+ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o bridge-amd64 main.go
12+
13+ FROM alpine:latest
14+
15+ WORKDIR /app
16+
17+ COPY --from=builder /app/bridge-amd64 /bin/bridge
18+
19+ EXPOSE 1323
20+
21+ CMD ["bridge" ]
You can’t perform that action at this time.
0 commit comments