@@ -16,31 +16,46 @@ permissions:
1616 packages : write
1717
1818jobs :
19- publish :
20- name : Publish ${{ matrix.name }} image
21- runs-on : ubuntu-latest
19+ build :
20+ name : Build ${{ matrix.name }} / ${{ matrix.arch }}
21+ runs-on : ${{ matrix.runner }}
2222 strategy :
2323 fail-fast : false
2424 matrix :
2525 include :
26+ # linuxserver variant
27+ - name : linuxserver
28+ dockerfile : Dockerfile
29+ image : ghcr.io/${{ github.repository_owner }}/plex-postgresql-linuxserver
30+ arch : amd64
31+ platform : linux/amd64
32+ runner : ubuntu-latest
2633 - name : linuxserver
2734 dockerfile : Dockerfile
2835 image : ghcr.io/${{ github.repository_owner }}/plex-postgresql-linuxserver
29- legacy_image : " "
36+ arch : arm64
37+ platform : linux/arm64
38+ runner : ubuntu-24.04-arm
39+ # plexinc variant
40+ - name : plexinc
41+ dockerfile : Dockerfile.standalone
42+ image : ghcr.io/${{ github.repository_owner }}/plex-postgresql-plexinc
43+ arch : amd64
44+ platform : linux/amd64
45+ runner : ubuntu-latest
3046 - name : plexinc
3147 dockerfile : Dockerfile.standalone
3248 image : ghcr.io/${{ github.repository_owner }}/plex-postgresql-plexinc
33- legacy_image : " "
49+ arch : arm64
50+ platform : linux/arm64
51+ runner : ubuntu-24.04-arm
3452
3553 steps :
3654 - name : Checkout
3755 uses : actions/checkout@v4
3856 with :
3957 ref : ${{ github.event_name == 'workflow_dispatch' && inputs.version || github.ref }}
4058
41- - name : Set up QEMU
42- uses : docker/setup-qemu-action@v3
43-
4459 - name : Set up Docker Buildx
4560 uses : docker/setup-buildx-action@v3
4661
@@ -61,29 +76,61 @@ jobs:
6176 echo "value=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT"
6277 fi
6378
64- - name : Resolve image tags
65- id : tags
66- run : |
67- set -eu
68- VERSION="${{ steps.version.outputs.value }}"
69- LEGACY_IMAGE="${{ matrix.legacy_image }}"
70- {
71- echo "value<<EOF"
72- echo "${{ matrix.image }}:${VERSION}"
73- echo "${{ matrix.image }}:latest"
74- if [ -n "$LEGACY_IMAGE" ]; then
75- echo "${LEGACY_IMAGE}:${VERSION}"
76- echo "${LEGACY_IMAGE}:latest"
77- fi
78- echo "EOF"
79- } >> "$GITHUB_OUTPUT"
80-
81- - name : Build and push image
79+ - name : Build and push per-platform image
8280 uses : docker/build-push-action@v6
8381 with :
8482 context : .
8583 file : ${{ matrix.dockerfile }}
86- platforms : linux/amd64,linux/arm64
84+ platforms : ${{ matrix.platform }}
8785 push : true
8886 provenance : false
89- tags : ${{ steps.tags.outputs.value }}
87+ tags : ${{ matrix.image }}:${{ steps.version.outputs.value }}-${{ matrix.arch }}
88+
89+ manifest :
90+ name : Create multi-arch manifest for ${{ matrix.name }}
91+ runs-on : ubuntu-latest
92+ needs : build
93+ strategy :
94+ fail-fast : false
95+ matrix :
96+ include :
97+ - name : linuxserver
98+ image : ghcr.io/${{ github.repository_owner }}/plex-postgresql-linuxserver
99+ - name : plexinc
100+ image : ghcr.io/${{ github.repository_owner }}/plex-postgresql-plexinc
101+
102+ steps :
103+ - name : Log in to GHCR
104+ uses : docker/login-action@v3
105+ with :
106+ registry : ghcr.io
107+ username : ${{ github.actor }}
108+ password : ${{ secrets.GITHUB_TOKEN }}
109+
110+ - name : Resolve version
111+ id : version
112+ run : |
113+ set -eu
114+ if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
115+ echo "value=${{ inputs.version }}" >> "$GITHUB_OUTPUT"
116+ else
117+ echo "value=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT"
118+ fi
119+
120+ - name : Create and push multi-arch manifest
121+ run : |
122+ set -eux
123+ VERSION="${{ steps.version.outputs.value }}"
124+ IMAGE="${{ matrix.image }}"
125+
126+ # Create versioned manifest
127+ docker manifest create "${IMAGE}:${VERSION}" \
128+ "${IMAGE}:${VERSION}-amd64" \
129+ "${IMAGE}:${VERSION}-arm64"
130+ docker manifest push "${IMAGE}:${VERSION}"
131+
132+ # Create latest manifest
133+ docker manifest create "${IMAGE}:latest" \
134+ "${IMAGE}:${VERSION}-amd64" \
135+ "${IMAGE}:${VERSION}-arm64"
136+ docker manifest push "${IMAGE}:latest"
0 commit comments