Skip to content

Commit

Permalink
build the container for multiple PostgreSQL versions
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni committed Jan 9, 2024
1 parent b79100d commit 4cf9220
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/container-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ jobs:
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
postgresql:
- 12
- 13
- 15
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -30,7 +37,7 @@ jobs:
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=12
type=raw,value=${{ matrix.postgresql }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
Expand All @@ -39,3 +46,5 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
POSTGRESQL_VERSION=${{ matrix.postgresql }}
9 changes: 9 additions & 0 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,22 @@ permissions:
jobs:
container:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
postgresql:
- 12
- 13
- 15
steps:
- uses: actions/checkout@v4
- name: Build container
uses: docker/build-push-action@v5
with:
file: Containerfile
tags: postgresql-evr:latest
build-args: |
POSTGRESQL_VERSION=${{ matrix.postgresql }}
- name: Run container
run: docker run -p 5432:5432 -e POSTGRES_PASSWORD=password --detach --name postgres postgresql-evr:latest
- name: Wait for the container to start up
Expand Down
3 changes: 2 additions & 1 deletion Containerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM postgres:12
ARG POSTGRESQL_VERSION=12
FROM postgres:${POSTGRESQL_VERSION}

COPY Makefile *.control *.sql /src/

Expand Down

0 comments on commit 4cf9220

Please sign in to comment.