Skip to content

Commit

Permalink
ci: allow platforms override per image
Browse files Browse the repository at this point in the history
  • Loading branch information
id committed Jul 2, 2024
1 parent c10931e commit b09d660
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
- uses: docker/build-push-action@15560696de535e4014efeff63c48f16952e52dd1 # v6.2.0
with:
push: true
platforms: linux/amd64,linux/arm64
platforms: ${{ matrix.image[2] }}
tags: ghcr.io/emqx/${{ matrix.image[0] }}:${{ matrix.image[1] }}
file: ${{ matrix.image[0] }}/Dockerfile
context: ${{ matrix.image[0] }}
7 changes: 6 additions & 1 deletion generate-matrix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ IMGS=''

while read dir; do
vsn=$(cat "${dir}/vsn")
img="[\"$dir\", \"$vsn\"]"
if [ -f "${dir}/platforms" ]; then
platforms=$(cat "${dir}/platforms")
else
platforms='linux/amd64,linux/arm64'
fi
img="[\"$dir\", \"$vsn\", \"$platforms\"]"
if [ -n "$IMGS" ]; then
IMGS="${IMGS},${img}"
else
Expand Down

0 comments on commit b09d660

Please sign in to comment.