File tree Expand file tree Collapse file tree 3 files changed +24
-4
lines changed Expand file tree Collapse file tree 3 files changed +24
-4
lines changed Original file line number Diff line number Diff line change 20
20
jobs :
21
21
build :
22
22
runs-on : ubuntu-latest
23
+ strategy :
24
+ matrix :
25
+ os : [ linux ]
26
+ arch : [ amd64 ]
23
27
steps :
24
28
- name : Checkout
25
29
uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
@@ -59,10 +63,13 @@ jobs:
59
63
provenance : false
60
64
build-args : |
61
65
APP_VERSION=dev-build.${{ steps.vars.outputs.short_sha }}
66
+ TARGET_OS=${{ matrix.os }}
67
+ TARGET_ARCH=${{ matrix.arch }}
62
68
push : false
63
69
load : true
64
70
tags : ${{ steps.meta.outputs.tags }}
65
71
labels : ${{ steps.meta.outputs.labels }}
72
+ platforms : ${{ matrix.os }}/${{ matrix.arch }}
66
73
cache-from : type=gha
67
74
cache-to : type=gha,mode=max
68
75
86
93
provenance : false
87
94
build-args : |
88
95
APP_VERSION=dev-build.${{ steps.vars.outputs.short_sha }}
96
+ TARGET_OS=${{ matrix.os }}
97
+ TARGET_ARCH=${{ matrix.arch }}
89
98
push : ${{ github.event_name != 'pull_request' }}
90
99
tags : ${{ steps.meta.outputs.tags }}
91
100
labels : ${{ steps.meta.outputs.labels }}
101
+ platforms : ${{ matrix.os }}/${{ matrix.arch }}
92
102
cache-from : type=gha
93
103
cache-to : type=gha,mode=max
Original file line number Diff line number Diff line change 15
15
jobs :
16
16
build :
17
17
runs-on : ubuntu-latest
18
+ strategy :
19
+ matrix :
20
+ os :
21
+ - linux
22
+ arch :
23
+ - amd64
24
+ - arm64
18
25
steps :
19
26
- name : Checkout
20
27
uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
@@ -50,11 +57,11 @@ jobs:
50
57
provenance : false
51
58
build-args : |
52
59
APP_VERSION=${{ github.ref_name }}
60
+ TARGET_OS=${{ matrix.os }}
61
+ TARGET_ARCH=${{ matrix.arch }}
53
62
push : ${{ startsWith(github.ref, 'refs/tags/') }}
54
63
tags : ${{ steps.meta.outputs.tags }}
55
64
labels : ${{ steps.meta.outputs.labels }}
56
- platforms : |
57
- linux/amd64
58
- linux/arm64
65
+ platforms : ${{ matrix.os }}/${{ matrix.arch }}
59
66
cache-from : type=gha
60
67
cache-to : type=gha,mode=max
Original file line number Diff line number Diff line change 2
2
FROM golang:1.24.5@sha256:14fd8a55e59a560704e5fc44970b301d00d344e45d6b914dda228e09f359a088 AS build-stage
3
3
4
4
ARG APP_VERSION=dev
5
+ ARG TARGET_OS=linux
6
+ ARG TARGET_ARCH=amd64
5
7
6
8
# Set destination for COPY
7
9
WORKDIR /app
@@ -20,7 +22,8 @@ COPY . ./
20
22
# Set build environment
21
23
ENV GOCACHE=/root/.cache/go-build \
22
24
CGO_ENABLED=0 \
23
- GOOS=linux
25
+ GOOS=${TARGET_OS} \
26
+ GOARCH=${TARGET_ARCH}
24
27
25
28
# Build and strip binary
26
29
RUN --mount=type=cache,target=/go/pkg/mod/ \
You can’t perform that action at this time.
0 commit comments