Skip to content

Commit 8a1b2f4

Browse files
authored
Ability to push ARM/AMD64 Operator UI images to GHCR (#2426)
* Updated to build for UI and push to GHCR * Enable build for both Operator and Operator UI
1 parent 375a467 commit 8a1b2f4

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

.github/workflows/publish_ghcr_image.yaml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: Publish multiarch postgres-operator image on ghcr.io
33
env:
44
REGISTRY: ghcr.io
55
IMAGE_NAME: ${{ github.repository }}
6+
IMAGE_NAME_UI: ${{ github.repository }}-ui
67

78
on:
89
push:
@@ -30,7 +31,13 @@ jobs:
3031
id: image
3132
run: |
3233
IMAGE="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${GITHUB_REF/refs\/tags\//}"
33-
echo "NAME=$IMAGE" >> $GITHUB_OUTPUT
34+
echo "NAME=${IMAGE,,}" >> $GITHUB_OUTPUT
35+
36+
- name: Define image name
37+
id: image_ui
38+
run: |
39+
IMAGE="${{ env.REGISTRY }}/${{ env.IMAGE_NAME_UI }}:${GITHUB_REF/refs\/tags\//}"
40+
echo "NAME=${IMAGE,,}" >> $GITHUB_OUTPUT
3441
3542
- name: Set up QEMU
3643
uses: docker/setup-qemu-action@v2
@@ -54,3 +61,14 @@ jobs:
5461
build-args: BASE_IMAGE=alpine:3.15
5562
tags: "${{ steps.image.outputs.NAME }}"
5663
platforms: linux/amd64,linux/arm64
64+
65+
- name: Build and push multiarch image to ghcr for UI
66+
uses: docker/build-push-action@v3
67+
with:
68+
context: ${{ github.workspace }}/ui
69+
file: ${{ github.workspace }}/ui/Dockerfile
70+
push: true
71+
build-args: BASE_IMAGE=alpine:3.15
72+
tags: "${{ steps.image_ui.outputs.NAME }}"
73+
platforms: linux/amd64,linux/arm64
74+

ui/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM registry.opensource.zalan.do/library/alpine-3.15:latest
1+
ARG BASE_IMAGE=registry.opensource.zalan.do/library/alpine-3.15:latest
2+
FROM ${BASE_IMAGE}
23
LABEL maintainer="Team ACID @ Zalando <[email protected]>"
34

45
EXPOSE 8081

0 commit comments

Comments
 (0)