Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 45 additions & 23 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
---
name: Docker PostGIS CI

on:
push:
pull_request:
schedule:
- cron: '15 5 * * 1'
- cron: "15 5 * * 1"

defaults:
run:
shell: bash

jobs:

make-docker-images:
strategy:
matrix:
postgres: [12, 13, 14, 15, 16, 17]
postgis: ['3.5']
postgis: ["3.5"]
variant: [default, alpine]
arch: ["linux/amd64", "linux/arm64"]
include:
- postgres: 16
postgis: master
Expand All @@ -26,31 +27,52 @@ jobs:
postgis: master
variant: default

name: Build docker image for ${{ matrix.postgres }}-${{ matrix.postgis }} variant ${{ matrix.variant }}
name: >-
Build docker image for
${{ matrix.arch }}-${{ matrix.postgres }}-${{ matrix.postgis }}
variant ${{ matrix.variant }}
runs-on: ubuntu-20.04
continue-on-error: ${{ matrix.postgis == 'master' }}
env:
VERSION: ${{ matrix.postgres }}-${{ matrix.postgis }}
ARCH: ${{ matrix.arch }}
VARIANT: ${{ matrix.variant }}

steps:
- name: Checkout source
uses: actions/checkout@v4

- name: Build docker image for ${{ env.VERSION }} ${{ env.VARIANT }}
run: make test

- name: Login to dockerhub
uses: docker/login-action@v3
if: ${{ (github.ref == 'refs/heads/master') && (github.event_name != 'pull_request') }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}

- name: Push docker image to dockerhub
if: ${{ (github.ref == 'refs/heads/master') && (github.event_name != 'pull_request') }}
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_ACCESS_TOKEN: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
run: make push
- name: Checkout source
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: >-
Build docker image for
${{ env.ARCH }}
${{ env.VERSION }}
${{ env.VARIANT }}
run: make test

- name: Login to dockerhub
uses: docker/login-action@v3
if: >-
${{
(github.ref == 'refs/heads/master') &&
(github.event_name != 'pull_request')
}}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}

- name: Push docker image to dockerhub
if: >-
${{
(github.ref == 'refs/heads/master') &&
(github.event_name != 'pull_request')
}}
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_ACCESS_TOKEN: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
run: make push
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ update:
define build-version
build-$1:
ifeq ($(do_default),true)
$(DOCKER) build --pull -t $(REPO_NAME)/$(IMAGE_NAME):$(shell echo $1) $1
$(DOCKER) build --platform=$(ARCH) --pull -t $(REPO_NAME)/$(IMAGE_NAME):$(shell echo $1) $1
$(DOCKER) images $(REPO_NAME)/$(IMAGE_NAME):$(shell echo $1)
endif
ifeq ($(do_alpine),true)
ifneq ("$(wildcard $1/alpine)","")
$(DOCKER) build --pull -t $(REPO_NAME)/$(IMAGE_NAME):$(shell echo $1)-alpine $1/alpine
$(DOCKER) build --platform=$(ARCH) --pull -t $(REPO_NAME)/$(IMAGE_NAME):$(shell echo $1)-alpine $1/alpine
$(DOCKER) images $(REPO_NAME)/$(IMAGE_NAME):$(shell echo $1)-alpine
endif
endif
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Unless `-e POSTGRES_DB` is passed to the container at startup time, this databas

# Versions (2025-01-23)

Supported architecture: `amd64` (also known as X86-64)"
Supported architectures: `amd64` (also known as X86-64)", `arm64`

Recommended versions for new users are: `postgis/postgis:17-3.5`, `postgis/postgis:16-3.5`

Expand Down
Loading