Skip to content

Commit eb84983

Browse files
split GHA builds
1 parent ff1beb5 commit eb84983

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

.github/workflows/build-image.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,27 @@ jobs:
3737
- name: Set up Docker Buildx
3838
uses: docker/setup-buildx-action@v3
3939

40-
- name: Build and push
41-
id: docker_build
40+
- name: Build and push (amd64)
4241
uses: docker/build-push-action@v6
4342
with:
4443
platforms: linux/amd64
4544
push: ${{ github.event_name == 'push' }}
4645
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
47-
cache-from: type=gha
48-
cache-to: type=gha,mode=max
46+
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache
47+
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache,mode=max,compression=zstd,oci-mediatypes=true
48+
provenance: false
49+
sbom: false
50+
51+
- name: Build and push (arm64)
52+
uses: docker/build-push-action@v6
53+
with:
54+
platforms: linux/arm64
55+
push: ${{ github.event_name == 'push' }}
56+
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
57+
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache
58+
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache,mode=max,compression=zstd,oci-mediatypes=true
59+
provenance: false
60+
sbom: false
4961

5062
- name: Generate artifact attestation
5163
uses: actions/attest-build-provenance@v2

Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ RUN apt-get update \
7777

7878
RUN install -dm 755 /etc/apt/keyrings \
7979
&& curl -fsSL https://mise.jdx.dev/gpg-key.pub | gpg --dearmor | tee /etc/apt/keyrings/mise-archive-keyring.gpg 1> /dev/null \
80-
&& echo "deb [signed-by=/etc/apt/keyrings/mise-archive-keyring.gpg arch=amd64] https://mise.jdx.dev/deb stable main" | tee /etc/apt/sources.list.d/mise.list \
80+
&& echo "deb [signed-by=/etc/apt/keyrings/mise-archive-keyring.gpg] https://mise.jdx.dev/deb stable main" | tee /etc/apt/sources.list.d/mise.list \
8181
&& apt-get update && apt-get install -y --no-install-recommends mise/stable \
8282
&& rm -rf /var/lib/apt/lists/* \
8383
&& echo 'eval "$(mise activate bash)"' >> /etc/profile \
@@ -202,7 +202,11 @@ RUN pipx install cpplint==2.0.* clang-tidy==20.1.* clang-format==20.1.* cmakelan
202202

203203
### BAZEL ###
204204

205-
RUN curl -L --fail https://github.com/bazelbuild/bazelisk/releases/download/v1.26.0/bazelisk-linux-amd64 -o /usr/local/bin/bazelisk \
205+
ARG TARGETOS
206+
ARG TARGETARCH
207+
ARG BAZELISK_VERSION=v1.26.0
208+
209+
RUN curl -L --fail https://github.com/bazelbuild/bazelisk/releases/download/${BAZELISK_VERSION}/bazelisk-${TARGETOS}-${TARGETARCH} -o /usr/local/bin/bazelisk \
206210
&& chmod +x /usr/local/bin/bazelisk \
207211
&& ln -s /usr/local/bin/bazelisk /usr/local/bin/bazel
208212

0 commit comments

Comments
 (0)