From f26c022397e60bf0ac2322bd8a08bb4ca20aecdd Mon Sep 17 00:00:00 2001 From: Yuliia Poplavska Date: Thu, 18 Aug 2022 18:58:54 +0300 Subject: [PATCH] add build action --- .github/workflows/build.yml | 9 +++++++-- server/Dockerfile | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e5d15e3..de1775d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,9 +24,14 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 - - name: build - run: make build + - name: Build and push + uses: docker/build-push-action@v2 + with: + context: server + platforms: linux/amd64,linux/arm64 +# - name: build +# run: make build - name: Set up Go uses: actions/setup-go@v2 diff --git a/server/Dockerfile b/server/Dockerfile index 51c0a77..290fc1a 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -12,7 +12,7 @@ ARG TARGETARCH ARG TARGETOS COPY . . -RUN RUN GOOS=$TARGETOS GOARCH=$TARGETARCH CGO_ENABLED=0 go build -v -ldflags "-X github.com/kubeshop/kusk-gateway/pkg/analytics.TelemetryToken=$TELEMETRY_TOKEN" -o kusk-gateway-api +RUN GOOS=$TARGETOS GOARCH=$TARGETARCH CGO_ENABLED=0 go build -v -ldflags "-X github.com/kubeshop/kusk-gateway/pkg/analytics.TelemetryToken=$TELEMETRY_TOKEN" -o kusk-gateway-api FROM --platform=$BUILDPLATFORM gcr.io/distroless/static:nonroot COPY --from=build --chown=65532:65532 /go/src/kusk-gateway-api ./