Publish multi-platform images
CI / test (push) Successful in 2m48s
CI / publish (push) Successful in 3m29s

This commit is contained in:
Joe Julian
2026-04-21 20:48:57 -07:00
parent 6097ea8093
commit 2b0094bc98
2 changed files with 5 additions and 1 deletions
+1
View File
@@ -53,6 +53,7 @@ jobs:
- name: Build and Push Image - name: Build and Push Image
env: env:
KO_DEFAULTBASEIMAGE: gcr.io/distroless/static-debian12:nonroot KO_DEFAULTBASEIMAGE: gcr.io/distroless/static-debian12:nonroot
KO_DEFAULTPLATFORMS: linux/amd64,linux/arm64
run: | run: |
push_host="$(git remote get-url origin | sed -E 's#^[a-z]+://([^/]+)/.*#\1#')" push_host="$(git remote get-url origin | sed -E 's#^[a-z]+://([^/]+)/.*#\1#')"
export KO_DOCKER_REPO="${push_host}/${GITHUB_REPOSITORY}" export KO_DOCKER_REPO="${push_host}/${GITHUB_REPOSITORY}"
+4 -1
View File
@@ -2,12 +2,15 @@ FROM golang:1.26 AS build
WORKDIR /src WORKDIR /src
ARG TARGETOS=linux
ARG TARGETARCH
COPY go.mod go.sum ./ COPY go.mod go.sum ./
RUN go mod download RUN go mod download
COPY . . COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags='-s -w' -o /out/alma-assignments-reporter . RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -trimpath -ldflags='-s -w' -o /out/alma-assignments-reporter .
FROM scratch FROM scratch