Skip to content

Commit 8d2809b

Browse files
committed
fix: update docker builds to support different versions
1 parent c1e7021 commit 8d2809b

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

.github/workflows/release.yaml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ jobs:
121121
build-and-push-docker:
122122
needs: build-and-publish
123123
runs-on: ubuntu-latest
124+
strategy:
125+
fail-fast: false
126+
matrix:
127+
pg_version: [13, 14, 15, 16, 17]
124128
steps:
125129
- uses: actions/checkout@v4
126130

@@ -138,15 +142,26 @@ jobs:
138142
username: ${{ github.actor }}
139143
password: ${{ secrets.GITHUB_TOKEN }}
140144

145+
- name: Docker meta
146+
id: meta
147+
uses: docker/metadata-action@v5
148+
with:
149+
images: ${{ env.DOCKER_IMAGE }}
150+
tags: |
151+
type=raw,value=${{ matrix.pg_version }}
152+
type=raw,value=latest,enable=${{ matrix.pg_version == 17 }}
153+
type=raw,value=${{ github.ref_name }},enable=${{ matrix.pg_version == 17 }}
154+
141155
- name: Build & push
142156
uses: docker/build-push-action@v4
143157
with:
144158
context: .
145159
push: true
146160
platforms: linux/amd64,linux/arm64
147-
tags: |
148-
${{ env.DOCKER_IMAGE }}:latest
149-
${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}
161+
build-args: |
162+
PG_VERSION=${{ matrix.pg_version }}
163+
tags: ${{ steps.meta.outputs.tags }}
164+
labels: ${{ steps.meta.outputs.labels }}
150165

151166

152167
# -------------------------------------------------------------

Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
ARG PG_VERSION=16
22
FROM postgres:${PG_VERSION}
33

4-
ARG PG_VERSION=16
5-
64
RUN apt update && apt install -y curl
75
RUN curl -sSL https://raw.githubusercontent.com/blitss/typeid-postgres/main/install.sh | bash
86

0 commit comments

Comments
 (0)