File tree Expand file tree Collapse file tree 3 files changed +61
-0
lines changed
Expand file tree Collapse file tree 3 files changed +61
-0
lines changed Original file line number Diff line number Diff line change 1+ target /
Original file line number Diff line number Diff line change 1+ name : OCI container image for swiftstream
2+
3+ on :
4+ push :
5+ tags : [ 'v*.*.*' ]
6+
7+ env :
8+ REGISTRY : ghcr.io
9+ IMAGE_NAME : ${{ github.repository }}
10+
11+ jobs :
12+ build :
13+ runs-on : ubuntu-latest
14+ permissions :
15+ contents : read
16+ packages : write
17+ steps :
18+ - uses : actions/checkout@v4
19+ - name : Log in to the GHCR
20+ uses : docker/login-action@v3
21+ with :
22+ registry : ${{ env.REGISTRY }}
23+ username : ${{ github.actor }}
24+ password : ${{ secrets.GITHUB_TOKEN }}
25+
26+ - name : Extract metadata (tags, labels) for Docker
27+ id : meta
28+ uses : docker/metadata-action@v5
29+ with :
30+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
31+
32+ - name : Set up QEMU
33+ uses : docker/setup-qemu-action@v3
34+
35+ - name : Set up Docker Buildx
36+ uses : docker/setup-buildx-action@v3
37+
38+ - name : Build and push Docker image
39+ id : push
40+ uses : docker/build-push-action@v6
41+ with :
42+ platforms : linux/amd64,linux/arm64
43+ context : .
44+ push : true
45+ tags : ${{ steps.meta.outputs.tags }}
46+ labels : ${{ steps.meta.outputs.labels }}
47+
Original file line number Diff line number Diff line change 1+ # Builder
2+ FROM rust:alpine AS builder
3+ WORKDIR /app
4+ COPY . .
5+ RUN apk add --no-cache --update alpine-sdk openssl-dev openssl-libs-static && \
6+ cargo build --release
7+
8+ # Production
9+ FROM alpine AS prod
10+
11+ COPY --from=builder /app/target/release/swiftstream .
12+
13+ CMD [ "./swiftstream" ]
You can’t perform that action at this time.
0 commit comments