Skip to content

Commit 3a4a498

Browse files
committed
Add multi-arch manifest creation job for PostgreSQL images
1 parent 9921352 commit 3a4a498

File tree

1 file changed

+37
-4
lines changed

1 file changed

+37
-4
lines changed

.github/workflows/postgresql.yml

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ jobs:
6565
- name: Set tags
6666
run: |
6767
if [ -z "$TAG" ]; then
68-
echo "TAG=-t openremote/postgresql:develop" >> $GITHUB_ENV
68+
echo "TAG=-t openremote/postgresql:develop-amd64" >> $GITHUB_ENV
6969
else
70-
echo "TAG=-t openremote/postgresql:latest -t openremote/postgresql:$TAG" >> $GITHUB_ENV
70+
echo "TAG=-t openremote/postgresql:$TAG-amd64" >> $GITHUB_ENV
7171
fi
7272
env:
7373
TAG: ${{ github.event.release.tag_name }}
@@ -144,9 +144,9 @@ jobs:
144144
- name: Set tags
145145
run: |
146146
if [ -z "$TAG" ]; then
147-
echo "TAG=-t openremote/postgresql:develop" >> $GITHUB_ENV
147+
echo "TAG=-t openremote/postgresql:develop-arm64" >> $GITHUB_ENV
148148
else
149-
echo "TAG=-t openremote/postgresql:latest -t openremote/postgresql:$TAG" >> $GITHUB_ENV
149+
echo "TAG=-t openremote/postgresql:$TAG-arm64" >> $GITHUB_ENV
150150
fi
151151
env:
152152
TAG: ${{ github.event.release.tag_name }}
@@ -180,3 +180,36 @@ jobs:
180180
--no-cache-filter trimmed \
181181
--no-cache-filter trimmed-all \
182182
$TAG .
183+
184+
create_manifest:
185+
needs: [image_postgresql_amd64, image_postgresql_arm64]
186+
runs-on: ubuntu-latest
187+
188+
steps:
189+
- name: Set tags
190+
run: |
191+
if [ -z "$TAG" ]; then
192+
echo "TAG=openremote/postgresql:develop" >> $GITHUB_ENV
193+
echo "TAG_AMD64=openremote/postgresql:develop-amd64" >> $GITHUB_ENV
194+
echo "TAG_ARM64=openremote/postgresql:develop-arm64" >> $GITHUB_ENV
195+
else
196+
echo "TAG=openremote/postgresql:$TAG" >> $GITHUB_ENV
197+
echo "TAG_LATEST=openremote/postgresql:latest" >> $GITHUB_ENV
198+
echo "TAG_AMD64=openremote/postgresql:$TAG-amd64" >> $GITHUB_ENV
199+
echo "TAG_ARM64=openremote/postgresql:$TAG-arm64" >> $GITHUB_ENV
200+
fi
201+
env:
202+
TAG: ${{ github.event.release.tag_name }}
203+
204+
- name: Login to DockerHub
205+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef
206+
with:
207+
username: ${{ secrets._TEMP_DOCKERHUB_USER }}
208+
password: ${{ secrets._TEMP_DOCKERHUB_PASSWORD }}
209+
210+
- name: Create and push multi-arch manifest
211+
run: |
212+
docker buildx imagetools create -t $TAG $TAG_AMD64 $TAG_ARM64
213+
if [ ! -z "$TAG_LATEST" ]; then
214+
docker buildx imagetools create -t $TAG_LATEST $TAG_AMD64 $TAG_ARM64
215+
fi

0 commit comments

Comments
 (0)