build the container for multiple PostgreSQL versions #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Container | |
on: | |
- pull_request | |
- push | |
permissions: | |
contents: read | |
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:${{ 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:${{ 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 | |
run: psql --host localhost --username postgres --command 'create extension evr;' | |
env: | |
PGPASSWORD: password |