Skip to content

Commit 9796b3d

Browse files
author
DJTBOT
committed
Build and push multi-arch docker tags
1 parent 2a72300 commit 9796b3d

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

.github/workflows/docker-image.yml

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,19 @@ permissions:
1010
contents: read
1111
packages: write
1212

13-
env:
14-
NIX_CONFIG: |
15-
experimental-features = nix-command flakes
16-
1713
jobs:
1814
build-and-push:
19-
runs-on: ubuntu-24.04-arm64
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
include:
19+
- runner: ubuntu-latest
20+
system: x86_64-linux
21+
suffix: amd64
22+
- runner: ubuntu-24.04-arm64
23+
system: aarch64-linux
24+
suffix: arm64
25+
runs-on: ${{ matrix.runner }}
2026
steps:
2127
- name: Checkout
2228
uses: actions/checkout@v4
@@ -39,12 +45,12 @@ jobs:
3945
fi
4046
echo "rev=$rev" >> "$GITHUB_OUTPUT"
4147
42-
- name: Build image (aarch64-linux)
48+
- name: Build image
4349
shell: bash
4450
run: |
4551
set -euo pipefail
4652
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
47-
nix build .#clawdbot-docker
53+
nix build .#packages.${{ matrix.system }}.clawdbot-docker
4854
4955
- name: Load image
5056
shell: bash
@@ -59,8 +65,9 @@ jobs:
5965
env:
6066
IMAGE: ghcr.io/clawdbot/clawdbot-gateway
6167
REV: ${{ steps.version.outputs.rev }}
68+
SUFFIX: ${{ matrix.suffix }}
6269
run: |
63-
docker tag clawdbot:latest "$IMAGE:latest"
64-
docker tag clawdbot:latest "$IMAGE:$REV"
65-
docker push "$IMAGE:latest"
66-
docker push "$IMAGE:$REV"
70+
docker tag clawdbot:latest "$IMAGE:latest-$SUFFIX"
71+
docker tag clawdbot:latest "$IMAGE:$REV-$SUFFIX"
72+
docker push "$IMAGE:latest-$SUFFIX"
73+
docker push "$IMAGE:$REV-$SUFFIX"

0 commit comments

Comments
 (0)