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 : [ '**' ]
6+
7+ jobs :
8+ build-and-push :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - name : Checkout code
12+ uses : actions/checkout@v4
13+
14+ - name : Set up Docker Buildx
15+ uses : docker/setup-buildx-action@v3
16+
17+ - name : Login to DockerHub
18+ uses : docker/login-action@v3
19+ with :
20+ username : ${{ secrets.DOCKERHUB_USERNAME }}
21+ password : ${{ secrets.DOCKERHUB_TOKEN }}
22+
23+ - name : Extract metadata for Docker
24+ id : meta
25+ uses : docker/metadata-action@v5
26+ with :
27+ images : audius/api
28+ tags : |
29+ type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
30+ type=sha,prefix=
31+
32+ - name : Build and push
33+ uses : docker/build-push-action@v5
34+ with :
35+ context : .
36+ push : true
37+ tags : ${{ steps.meta.outputs.tags }}
38+ labels : ${{ steps.meta.outputs.labels }}
39+ cache-from : type=registry,ref=audius/api:buildcache
40+ cache-to : type=registry,ref=audius/api:buildcache,mode=max
Original file line number Diff line number Diff line change 1+ FROM golang:1.24-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