Skip to content

Commit 9ca4918

Browse files
committed
Fix build workflow: use docker/build-push-action with correct arch mapping and image naming
1 parent f00b5e4 commit 9ca4918

2 files changed

Lines changed: 24 additions & 8 deletions

File tree

.github/workflows/build.yaml

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,28 @@ jobs:
2626
username: ${{ github.actor }}
2727
password: ${{ secrets.GITHUB_TOKEN }}
2828

29+
- name: Set up QEMU
30+
uses: docker/setup-qemu-action@v3
31+
32+
- name: Set up Docker Buildx
33+
uses: docker/setup-buildx-action@v3
34+
35+
- name: Get version
36+
id: version
37+
run: |
38+
if [[ "${{ github.event_name }}" == "release" ]]; then
39+
echo "version=${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT
40+
else
41+
echo "version=dev" >> $GITHUB_OUTPUT
42+
fi
43+
2944
- name: Build and push
30-
uses: home-assistant/builder@2024.03.5
45+
uses: docker/build-push-action@v5
3146
with:
32-
args: |
33-
--${{ matrix.arch }} \
34-
--target /data/meshcentral \
35-
--image "ha-meshcentral-addon/meshcentral" \
36-
--docker-hub "ghcr.io/andlo" \
37-
--version ${{ github.ref_name }}
47+
context: ./meshcentral
48+
file: ./meshcentral/Dockerfile
49+
platforms: linux/${{ matrix.arch == 'amd64' && 'amd64' || matrix.arch == 'aarch64' && 'arm64' || matrix.arch == 'armhf' && 'arm/v6' || matrix.arch == 'armv7' && 'arm/v7' || 'i386' }}
50+
push: true
51+
tags: ghcr.io/andlo/ha-meshcentral-addon/meshcentral-${{ matrix.arch }}:${{ steps.version.outputs.version }}
52+
build-args: |
53+
BUILD_FROM=ghcr.io/home-assistant/${{ matrix.arch }}-base:latest

meshcentral/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"map": [
2727
"data:rw"
2828
],
29-
"image": "ghcr.io/andlo/ha-meshcentral-addon/meshcentral",
29+
"image": "ghcr.io/andlo/ha-meshcentral-addon/meshcentral-{arch}",
3030
"homeassistant_api": false,
3131
"hassio_api": false
3232
}

0 commit comments

Comments
 (0)