Skip to content

Commit c6d50e6

Browse files
chore: Update GitHub Actions workflow for multi-arch Docker image builds
1 parent 179c252 commit c6d50e6

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

.github/workflows/publish.yml

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,47 +16,49 @@ jobs:
1616
- name: Checkout code
1717
uses: actions/checkout@v4
1818

19+
# 1. QEMU setup for cross-platform emulation
20+
- name: Set up QEMU
21+
uses: docker/setup-qemu-action@v3
22+
with:
23+
platforms: all
24+
25+
# 2. Buildx setup (ensures we have a multi-arch builder)
1926
- name: Set up Docker Buildx
20-
uses: docker/setup-buildx-action@v2
27+
uses: docker/setup-buildx-action@v3
28+
with:
29+
install: true
2130

2231
- name: Log in to GitHub Container Registry
23-
uses: docker/login-action@v2
32+
uses: docker/login-action@v3
2433
with:
2534
registry: ghcr.io
2635
username: ${{ github.actor }}
2736
password: ${{ secrets.GITHUB_TOKEN }}
2837

29-
- name: Set image tags
30-
id: meta
31-
run: |
32-
BRANCH_NAME=${GITHUB_REF##*/}
33-
echo "branch_tag=${BRANCH_NAME//\//-}" >> "$GITHUB_OUTPUT"
34-
38+
# 3. Multi-arch GPU image
3539
- name: Build and push GPU Docker image
3640
uses: docker/build-push-action@v4
3741
with:
3842
context: .
3943
file: ./Dockerfile.pb
44+
platforms: linux/amd64,linux/arm64
4045
push: true
4146
tags: |
4247
ghcr.io/${{ github.repository }}:latest-gpu
43-
ghcr.io/${{ github.repository }}:${{ steps.meta.outputs.branch_tag }}-gpu
48+
ghcr.io/${{ github.repository }}:${{ github.sha }}-gpu
4449
build-args: |
45-
BUILD_TYPE=gpu
46-
PY_VER=3.10
47-
TF_VER=2.9.2
48-
CUDA_TAG=11.2.2-cudnn8-runtime-ubuntu20.04
50+
BASE_IMAGE=tensorflow/tensorflow:2.9.2-gpu
4951
52+
# 4. Multi-arch CPU image
5053
- name: Build and push CPU Docker image
5154
uses: docker/build-push-action@v4
5255
with:
5356
context: .
5457
file: ./Dockerfile.pb
58+
platforms: linux/amd64,linux/arm64
5559
push: true
5660
tags: |
5761
ghcr.io/${{ github.repository }}:latest-cpu
58-
ghcr.io/${{ github.repository }}:${{ steps.meta.outputs.branch_tag }}-cpu
62+
ghcr.io/${{ github.repository }}:${{ github.sha }}-cpu
5963
build-args: |
60-
BUILD_TYPE=cpu
61-
PY_VER=3.10
62-
TF_VER=2.9.2
64+
BASE_IMAGE=tensorflow/tensorflow:2.9.2

0 commit comments

Comments
 (0)