name: 'Build & Push to Docker Hub'

on:
    push:
        branches:
            - docker

jobs:
    release:
        runs-on: ubuntu-latest
        steps:
        -
            name: Checkout
            uses: actions/checkout@v1
        -
            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: crazy-max/ghaction-docker-buildx@v1
            with:
                version: latest
        -
            name: Build dockerfile (with push)
            run: |
                docker buildx build \
                --platform=linux/amd64,linux/arm/v7,linux/arm64 \
                --output "type=image,push=true" \
                --file ./compose/production/django/Dockerfile . \
                --tag jdbeeler/fermentrack:latest

Add GitHub action to build Docker image and push to Docker hub
Add GitHub action to build Docker image and push to Docker hub
