Skip to content

Commit 27be841

Browse files
committed
Workflow build to publish AMD64 and ARM64 images
1 parent 32f998e commit 27be841

File tree

2 files changed

+42
-33
lines changed

2 files changed

+42
-33
lines changed

.github/workflows/docker-publish.yml

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build and Push Docker Image
1+
name: Build and Push Docker Images (Separate Arch)
22

33
on:
44
push:
@@ -7,12 +7,11 @@ on:
77
workflow_dispatch:
88

99
jobs:
10-
build-and-push:
10+
build-and-push-amd64:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Checkout repository
1414
uses: actions/checkout@v4
15-
id: checkout
1615

1716
- name: Set short SHA
1817
id: vars
@@ -27,12 +26,49 @@ jobs:
2726
username: ${{ secrets.DOCKERHUB_USERNAME }}
2827
password: ${{ secrets.DOCKERHUB_TOKEN }}
2928

30-
- name: Build and push Docker image
29+
- name: Build and push amd64 Docker image
3130
uses: docker/build-push-action@v5
3231
with:
3332
context: .
3433
push: true
34+
platforms: linux/amd64
3535
tags: |
36-
luismachadoreis/postgres-multidb-pgvector:${{ steps.vars.outputs.short_sha }}
37-
luismachadoreis/postgres-multidb-pgvector:pg17
36+
luismachadoreis/postgres-multidb-pgvector:pg17-${{ steps.vars.outputs.short_sha }}
37+
luismachadoreis/postgres-multidb-pgvector:pg17
38+
luismachadoreis/postgres-multidb-pgvector:pg17-amd64
3839
luismachadoreis/postgres-multidb-pgvector:latest
40+
luismachadoreis/postgres-multidb-pgvector:latest-amd64
41+
42+
build-and-push-arm64:
43+
runs-on: ubuntu-latest
44+
steps:
45+
- name: Checkout repository
46+
uses: actions/checkout@v4
47+
48+
- name: Set short SHA
49+
id: vars
50+
run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
51+
52+
- name: Set up QEMU
53+
uses: docker/setup-qemu-action@v3
54+
55+
- name: Set up Docker Buildx
56+
uses: docker/setup-buildx-action@v3
57+
58+
- name: Log in to Docker Hub
59+
uses: docker/login-action@v3
60+
with:
61+
username: ${{ secrets.DOCKERHUB_USERNAME }}
62+
password: ${{ secrets.DOCKERHUB_TOKEN }}
63+
64+
- name: Build and push arm64 Docker image
65+
uses: docker/build-push-action@v5
66+
with:
67+
context: .
68+
push: true
69+
platforms: linux/arm64
70+
tags: |
71+
luismachadoreis/postgres-multidb-pgvector:pg17-${{ steps.vars.outputs.short_sha }}-arm64
72+
luismachadoreis/postgres-multidb-pgvector:pg17-arm64
73+
luismachadoreis/postgres-multidb-pgvector:pg17-arm64-${{ steps.vars.outputs.short_sha }}
74+
luismachadoreis/postgres-multidb-pgvector:latest-arm64

Dockerfile-arm

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)