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 authored and ehelms committed Jan 9, 2024
1 parent b79100d commit ed81a6e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 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 }}
13 changes: 11 additions & 2 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,24 @@ 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
tags: postgresql-evr:${{ matrix.postgresql }}
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
run: docker run -p 5432:5432 -e POSTGRES_PASSWORD=password --detach --name postgres postgresql-evr:${{ matrix.postgresql }}
- name: Wait for the container to start up
run: 'while ! docker exec postgres pg_isready; do sleep 1; done'
- name: Create extension in the container
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 ed81a6e

Please sign in to comment.