Skip to content

Commit d0ba054

Browse files
committed
chore: build postgres 14 and 18
1 parent 83450f6 commit d0ba054

2 files changed

Lines changed: 18 additions & 6 deletions

File tree

.github/workflows/publish.yaml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,21 @@ env:
1313

1414
jobs:
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
@@ -37,9 +45,9 @@ jobs:
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)
@@ -53,9 +61,11 @@ jobs:
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

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ RUN npm ci --omit=dev
3030

3131
# Final image
3232
ARG PG_IMAGE
33+
FROM ghcr.io/query-doctor/postgres:${PG_IMAGE} AS postgres-source
34+
3335
ENV LD_LIBRARY_PATH="/usr/local/lib"
3436
FROM node:24-alpine
3537

@@ -46,7 +48,7 @@ RUN apk add -uU --no-cache \
4648
# Copy pgBadger
4749
COPY --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
5254
COPY --from=build /app/dist /app/dist

0 commit comments

Comments
 (0)