Skip to content

Commit

Permalink
speedup arm build
Browse files Browse the repository at this point in the history
  • Loading branch information
sepich committed Nov 19, 2023
1 parent 61957eb commit 635e2f3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
18 changes: 17 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,22 @@ jobs:
steps:
- uses: actions/checkout@v4

# tests takes too long inside docker arm buildx
- uses: actions/setup-go@v4
with:
go-version-file: go.mod
- run: |
make test
GOOS=darwin GOARCH=arm64 make build
zip thanos-kit-darwin-arm64.zip thanos-kit
GOOS=darwin GOARCH=amd64 make build
zip thanos-kit-darwin-amd64.zip thanos-kit
GOOS=linux GOARCH=amd64 build
zip thanos-kit-linux-amd64.zip thanos-kit
- uses: actions/upload-artifact@v3
with:
path: thanos-kit*.zip

- name: Docker meta
id: meta
uses: docker/metadata-action@v3
Expand Down Expand Up @@ -40,6 +56,6 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
VER=${{ env.DOCKER_METADATA_OUTPUT_VERSION }}
VER=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
cache-from: type=gha
cache-to: type=gha,mode=max
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ RUN go mod download -x
# resets caches
COPY . .
ARG VER
RUN make test && make build
RUN make build

FROM quay.io/prometheus/busybox:latest
COPY --from=builder /build/thanos-kit /bin/thanos-kit
Expand Down

0 comments on commit 635e2f3

Please sign in to comment.