Skip to content

Merge pull request #15 from ruxwez/docs #20

Merge pull request #15 from ruxwez/docs

Merge pull request #15 from ruxwez/docs #20

Workflow file for this run

name: Build and Push Docker Images
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build-and-push:
runs-on: ubuntu-latest
strategy:
matrix:
postgres_version: ["latest", "18", "17", "16", "15", "14"]
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PERSONAL_KEY }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: .docker/Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: |
${{ secrets.DOCKER_USERNAME }}/postgres:${{ matrix.postgres_version }}
build-args: |
POSTGRES_VERSION=${{ matrix.postgres_version }}
cache-from: type=gha
cache-to: type=gha,mode=max