Docker Image CI #422
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: Docker Image CI | |
on: | |
schedule: | |
- cron: '0 5 * * *' | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
jobs: | |
bld-and-push: | |
strategy: | |
matrix: | |
version: ['13', '14', '15', '16'] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Build the Docker image | |
if: matrix.version != '15.2' | |
run: docker build . --build-arg POSTGRES_VERSION=${{ matrix.version }} -t ${{ vars.DOCKER_REG }}/pg_dump:${{ matrix.version }} --file Dockerfile | |
- name: Build the latest Docker image | |
if: matrix.version == '15.2' | |
run: docker build . --build-arg POSTGRES_VERSION=${{ matrix.version }} -t ${{ vars.DOCKER_REG }}/pg_dump:${{ matrix.version }} -t ${{ vars.DOCKER_REG }}/pg_dump:latest --file Dockerfile | |
- name: Log into docker.io | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c | |
with: | |
registry: docker.io | |
username: ${{ vars.DOCKER_REG }} | |
password: ${{ secrets.DOCKER_PAT }} | |
- name: Push the Docker image | |
run: docker push ${{ vars.DOCKER_REG }}/pg_dump:${{ matrix.version }} | |