name: Build and push Docker images

on:
  push:
    branches:
      - master

jobs:
  path-context:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2.3.4

      - name: Set up QEMU
        uses: docker/setup-qemu-action@v1.2.0

      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v1.3.0

      - name: Login to DockerHub
        uses: docker/login-action@v1.9.0
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}

      - name: Build base image
        uses: docker/build-push-action@v2.5.0
        with:
          context: .
          file: extras/docker/base/Dockerfile
          push: true
          tags: wger/base:latest,wger/base:2.1-dev

      - name: Build apache image
        uses: docker/build-push-action@v2.5.0
        with:
          context: .
          file: extras/docker/apache/Dockerfile
          push: true
          tags: wger/apache:latest,wger/apache:2.1-dev

      - name: Build dev image
        uses: docker/build-push-action@v2.5.0
        with:
          context: .
          file: extras/docker/development/Dockerfile
          push: true
          tags: wger/devel:latest,wger/devel:2.1-dev

name: Build and push Docker images

on:
  push:
    branches:
      - master

jobs:
  path-context:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2.3.4

      - name: Set up QEMU
        uses: docker/setup-qemu-action@v1.2.0

      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v1.3.0

      - name: Login to DockerHub
        uses: docker/login-action@v1.9.0
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}

      #- name: Build base image
      #  uses: docker/build-push-action@v2.5.0
      #  with:
      #    context: .
      #    file: extras/docker/base/Dockerfile
      #    push: true
      #    tags: wger/base:latest,wger/base:2.1-dev

      - name: Build apache image
        uses: docker/build-push-action@v2.5.0
        with:
          context: .
          file: extras/docker/apache/Dockerfile
          push: true
          tags: wger/apache:latest,wger/apache:2.1-dev

      - name: Build dev image
        uses: docker/build-push-action@v2.5.0
        with:
          context: .
          file: extras/docker/development/Dockerfile
          push: true
          tags: wger/devel:latest,wger/devel:2.1-dev

Comment again building of base image
Comment again building of base image

This could be done locally, but letting Github do it ensures that the image
is built from a clean source
