name: docker-build-push-edge

on:
  push:
    branches:
    - master
  pull_request:

jobs:
  build:

    runs-on: ubuntu-latest

    strategy:
      matrix:
        baseimage-tag: ['13-3.1']   # base image tags for 'edge' image
        variant: ['', '-alpine']        # image variants: '' = debian

    steps:
    -
      name: Checkout repo
      uses: actions/checkout@v2
    -
      name: Docker login
      id: docker_login
      uses: docker/login-action@v1.8.0
      with:
        username: ${{ secrets.DOCKERHUB_USERNAME }}
        password: ${{ secrets.DOCKERHUB_PASSWORD }}
    -
      name: Build and push image
      id: docker_build
      uses: docker/build-push-action@v2.2.2
      with:
        context: ./postgresql
        push: false
        tags: 3dcitydb/3dcitydb-pg:edge${{ matrix.variant }}
        build-args: |
          BASEIMAGE_TAG=${{ matrix.baseimage-tag }}${{ matrix.variant }}
    -
      name: Image digest
      run: echo ${{ steps.docker_build.outputs.digest }}

Test docker build for PRs and push to master
Test docker build for PRs and push to master
