Skip to content

Create GH Action to Sync README #13

Create GH Action to Sync README

Create GH Action to Sync README #13

Workflow file for this run

name: Publish Docker image
on:
workflow_dispatch:
push:
branches: ["main"]
jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
strategy:
matrix:
postgres_version: [12, 13, 14, 15, 16]
os: [ubuntu, alpine]
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: binaryoverload/postgresql-client
tags: |
type=raw,value=${{ matrix.postgres_version }},enable=${{ matrix.os == 'ubuntu' }}
type=raw,value=${{ matrix.postgres_version }}-${{ matrix.os }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64,linux/arm
file: ./Dockerfile.${{ matrix.os }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
POSTGRES_VERSION=${{ matrix.postgres_version }}
cache-from: type=gha
cache-to: type=gha,mode=max