Skip to content

Commit 8315d46

Browse files
committed
Allow specifying build platforms
1 parent e4542c6 commit 8315d46

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,13 @@ on:
2323
required: false
2424
build-arm:
2525
type: boolean
26-
description: "Enable aarch64 build"
26+
description: "Enable aarch64 build. If specified, `platforms` takes precedence over `build-arm`."
2727
required: false
2828
default: true
29+
platforms:
30+
type: string
31+
description: "Specify build platforms. Takes precedence over `build-arm`."
32+
required: false
2933
secrets:
3034
build-secrets:
3135
description: "The Docker secrets to use for the build"
@@ -83,7 +87,7 @@ jobs:
8387
context: ${{ inputs.build-context || '.'}}
8488
target: ${{ inputs.build-target }}
8589
push: ${{ (github.event_name == 'push' && (github.ref_name == github.event.repository.default_branch || github.ref_type == 'tag')) || github.event_name == 'pull_request' }}
86-
platforms: ${{ inputs.build-arm && github.ref_name == github.event.repository.default_branch && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
90+
platforms: ${{ inputs.platforms && inputs.platforms || (inputs.build-arm && github.ref_name == github.event.repository.default_branch && 'linux/amd64,linux/arm64' || 'linux/amd64') }}
8791
provenance: false
8892
tags: ${{ steps.meta.outputs.tags }}
8993
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)