Skip to content

Update build-and-push-images.yml #3

Update build-and-push-images.yml

Update build-and-push-images.yml #3

name: Build Images
on:
push:
branches: ['master']
permissions:
packages: write
contents: read
jobs:
build-and-push-image:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- { postgres: 12, alpine: '3.12' }
- { postgres: 13, alpine: '3.14' }
- { postgres: 14, alpine: '3.16' }
- { postgres: 15, alpine: '3.17' }
- { postgres: 16, alpine: '3.19' }
- { postgres: 17, alpine: '3.21' }
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Buildx
uses: docker/setup-buildx-action@v3
- name: Login Docker registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ghcr.io/${{ github.repository }}:${{ matrix.postgres }}
build-args: |
ALPINE_VERSION=${{ matrix.alpine }}
platforms: |
linux/amd64
linux/arm64