name: 'Build & Push to Docker Hub'

on:
  push:
    branches:
      - docker

jobs:
  buildx:
    runs-on: ubuntu-latest
    steps:
      -
        name: Checkout
        uses: actions/checkout@v2
      -
        name: Set up QEMU
        uses: docker/setup-qemu-action@v1
        with:
          platforms: all
      -
        name: Dockerhub login
        env:
          DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
          DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
        run: |
          echo "${DOCKER_PASSWORD}" | docker login --username ${DOCKER_USERNAME} --password-stdin
      -
        name: Set up Docker Buildx
        id: buildx
        uses: docker/setup-buildx-action@v1
        with:
          version: latest
      -
        name: Build dockerfile (armv7/amd64/arm64)
        run: |
          docker buildx build \
          --platform=linux/arm/v7,linux/amd64 \
          --output "type=image,push=true" \
          --file ./compose/production/django/Dockerfile . \
          --tag jdbeeler/fermentrack:latest

name: 'Build & Push to Docker Hub'

on:
  push:
    branches:
      - dev
      - master

jobs:
  buildx:
    runs-on: ubuntu-latest
    steps:
      -
        name: Checkout
        uses: actions/checkout@v2
      -
        name: Set up QEMU
        uses: docker/setup-qemu-action@v1
        with:
          platforms: all
      -
        name: Dockerhub login
        env:
          DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
          DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
        run: |
          echo "${DOCKER_PASSWORD}" | docker login --username ${DOCKER_USERNAME} --password-stdin
      -
        name: Set up Docker Buildx
        id: buildx
        uses: docker/setup-buildx-action@v1
        with:
          version: latest
      -
        name: Build dockerfile (armv7/amd64/arm64)
        run: |
          docker buildx build \
          --platform=linux/arm/v7,linux/amd64 \
          --output "type=image,push=true" \
          --file ./compose/production/django/Dockerfile . \
          --tag jdbeeler/fermentrack:latest

Update github actions to build docker container on pushes to dev and master for now
Update github actions to build docker container on pushes to dev and master for now
