Skip to content

Commit

Permalink
Merge pull request #20 from bap14/feature/extra-db-support
Browse files Browse the repository at this point in the history
Feature/extra db support
  • Loading branch information
navarr authored Feb 24, 2024
2 parents c818f1c + 16bbd47 commit 7b155d6
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 1 deletion.
62 changes: 62 additions & 0 deletions .github/workflows/postgres.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Docker Image PostgreSQL
on:
workflow_dispatch:
schedule:
- cron: "0 6 * * *" # 6 AM Daily
push:
paths:
- postgres/**
- .github/workflows/postgres.yml

jobs:
postgres:
name: PostgreSQL
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
version:
- "16"
- "15"
- "14"
- "13"
- "12"

steps:
- uses: actions/checkout@v3
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2

- name: Login to Github Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
if: ${{ !env.ACT }}

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
if: ${{ !env.ACT }}

- name: Set build-args
run: |-
ESCAPED_VERSION="$(echo ${{ matrix.version }} | sed 's/\./\\\./g')"
POSTGRES_VERSION=$(
docker run --rm gcr.io/go-containerregistry/crane:v0.8.0 ls postgres \
| egrep "^${ESCAPED_VERSION}(\.[0-9]+)?(-alpine)?\$" | sort -Vr | head -n1
)
echo "POSTGRES_VERSION=${POSTGRES_VERSION}" | tee /dev/stderr >> $GITHUB_ENV
- uses: docker/build-push-action@v3
with:
context: postgres
platforms: linux/amd64,linux/arm64
build-args: POSTGRES_VERSION=${{ env.POSTGRES_VERSION }}
push: ${{ github.ref == 'refs/heads/main' && !env.ACT }}
tags: ghcr.io/${{ github.repository_owner }}/postgres:${{ matrix.version }},wardenenv/postgres:${{matrix.version}}

2 changes: 1 addition & 1 deletion php/cli/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM quay.io/centos/centos:stream9

ARG PHP_VERSION
ARG PHP_EXTENSIONS="bcmath cli common gd gmp intl json mbstring \
mcrypt sodium mysqlnd opcache pdo pecl-msgpack pecl-amqp pecl-redis pecl-imagick pecl-zip process soap xml xmlrpc"
mcrypt sodium mysqlnd pgsql opcache pdo pdo_pgdql pecl-msgpack pecl-amqp pecl-redis pecl-imagick pecl-zip process soap xml xmlrpc"

RUN dnf update -y \
&& dnf clean all \
Expand Down
5 changes: 5 additions & 0 deletions postgres/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ARG POSTGRES_VERSION
FROM pgsql:${POSTGRES_VERSION}

COPY docker-entrypoint-initdb.d/uuid-ossp-extension.sql /docker-entrypoint-init.d/uuid-ossp-extension.sql

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE EXTENSION "uuid-ossp";

0 comments on commit 7b155d6

Please sign in to comment.