File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313
1414jobs :
1515 build :
16- name : Publish container
16+ name : Publish container (${{ matrix.pg_image }})
1717 permissions :
1818 id-token : write
1919 contents : read
2020 attestations : write
2121 packages : write
2222 runs-on : ubuntu-24.04
23+ strategy :
24+ matrix :
25+ pg_image :
26+ - pg14-timescale-2.16
27+ - pg18
28+ include :
29+ - pg_image : pg18
30+ latest : true
2331 steps :
2432 - uses : actions/checkout@v4
2533 - name : Login to ghcr
3745 uses : actions/cache@v4
3846 with :
3947 path : /tmp/.buildx-cache
40- key : ${{ runner.os }}-buildx-${{ github.sha }}
48+ key : ${{ runner.os }}-buildx-${{ matrix.pg_image }}-${{ github.sha }}
4149 restore-keys : |
42- ${{ runner.os }}-buildx-
50+ ${{ runner.os }}-buildx-${{ matrix.pg_image }}-
4351 - name : Set sync_version from package.json
4452 run : |
4553 sync_version=$(jq -r '.version' package.json)
5361 push : ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
5462 # outputs: type=docker
5563 platforms : linux/amd64,linux/arm64
64+ build-args : |
65+ PG_IMAGE=${{ matrix.pg_image }}
5666 tags : |
57- ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
58- ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.sync_version }}
67+ ${{ matrix.latest && format('{0}/{1}:latest', env.REGISTRY, env. IMAGE_NAME) || '' }}
68+ ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.sync_version }}-${{ matrix.pg_image }}
5969 cache-from : type=local,src=/tmp/.buildx-cache
6070 cache-to : type=local,mode=max,dest=/tmp/.buildx-cache-new
6171 # This ugly bit is necessary if you don't want your cache to grow forever
Original file line number Diff line number Diff line change @@ -30,6 +30,8 @@ RUN npm ci --omit=dev
3030
3131# Final image
3232ARG PG_IMAGE
33+ FROM ghcr.io/query-doctor/postgres:${PG_IMAGE} AS postgres-source
34+
3335ENV LD_LIBRARY_PATH="/usr/local/lib"
3436FROM node:24-alpine
3537
@@ -46,7 +48,7 @@ RUN apk add -uU --no-cache \
4648# Copy pgBadger
4749COPY --from=pgbadger-builder /usr/local/bin/pgbadger /usr/local/bin/pgbadger
4850
49- COPY --from=ghcr.io/query-doctor/ postgres:pg14-timescale-2.16 /usr/local/pgsql /usr/local/pgsql
51+ COPY --from=postgres-source /usr/local/pgsql /usr/local/pgsql
5052
5153# Copy application
5254COPY --from=build /app/dist /app/dist
You can’t perform that action at this time.
0 commit comments