Skip to content

Release both pg 15 and 16 #3

Release both pg 15 and 16

Release both pg 15 and 16 #3

name: Build and Push Docker Image
on:
push:
branches: [main]
paths:
- 'Dockerfile'
- '.github/workflows/docker-publish.yml'
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: eigenwallet/postgres-pgcron
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
pg_version: [15, 16]
include:
- pg_version: 15
is_latest: false
- pg_version: 16
is_latest: true
steps:
- name: Checkout repository
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: Log in to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=${{ matrix.pg_version }}
type=raw,value=latest,enable=${{ matrix.is_latest }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
build-args: |
PG_VERSION=${{ matrix.pg_version }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=pg-${{ matrix.pg_version }}
cache-to: type=gha,mode=max,scope=pg-${{ matrix.pg_version }}