From 1f69390106eaafeb85657c97448b154e2d98d92f Mon Sep 17 00:00:00 2001
From: Benjamin Bachmann <benniphx@gmail.com>
Date: Wed, 29 May 2024 14:24:42 +0200
Subject: [PATCH] added build file

---
 .github/workflows/main.yml | 66 ++++++++------------------------------
 1 file changed, 14 insertions(+), 52 deletions(-)

diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 9687a2a4..ec128ac9 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -1,56 +1,18 @@
-name: Docker PostGIS CI
+name: Build Test Deploy
 
 on:
   push:
-  pull_request:
-  schedule:
-    - cron: '15 5 * * 1'
-
-defaults:
-  run:
-    shell: bash
-
+    branches:
+      - 'master'
 jobs:
-
-  make-docker-images:
-    strategy:
-      matrix:
-        postgres: [12, 13, 14, 15, 16]
-        postgis: ['3.4']
-        variant: [default, alpine]
-        include:
-          - postgres: 15
-            postgis: master
-            variant: default
-          - postgres: 16
-            postgis: master
-            variant: default
-
-    name: Build docker image for ${{ matrix.postgres }}-${{ matrix.postgis }} variant ${{ matrix.variant }}
-    runs-on: ubuntu-20.04
-    continue-on-error: ${{ matrix.postgis == 'master' }}
-    env:
-      VERSION: ${{ matrix.postgres }}-${{ matrix.postgis }}
-      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
-
+  build-docker:
+    runs-on: ubuntu-latest
+        - name: Build and push Docker images
+          uses: docker/build-push-action@v5
+          with:
+            context: .
+            file: 13-3.4/alpine/Dockerfile
+            platforms: linux/amd64,linux/arm64
+            push: true
+            tags: |
+              ghcr.io/jobrad-gmbh/postgis:13-3.4-alpine