name: Build and publish Docker image
on:
  push:
    branches:
      - main
      - dev
      - 'sprint*'
jobs:
  push_to_registry:
    name: Push Docker image to Docker Hub
    runs-on: ubuntu-latest
    steps:
      - name: Check out the repo
        uses: actions/checkout@v2
      - name: Push to Docker Hub
        uses: docker/build-push-action@v2
        with:
          dockerfile: release/Dockerfile.tiny
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}
          repository: catalystcoop/pudl_etl
          tag_with_ref: true

name: Build and publish Docker image
on:
  push:
    branches:
      - main
      - dev
      - 'sprint*'
      - dockerbuild  # for testing purposes
jobs:
  push_to_registry:
    name: Push Docker image to Docker Hub
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Code
        uses: actions/checkout@v2
      - name: Login to DockerHub
        uses: docker/login-action@v1
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}
      - name: Build and push
        uses: docker/build-push-action@v2
        with:
          file: release/Dockerfile.tiny
          repository: catalystcoop/pudl_etl
          push: true
          cache-from: type=registry,ref=catalystcoop/pudl_etl:latest
          cache-to: type=inline
          tag_with_ref: true
          add_git_labels: true


Upgrade docker build action to @v2
Upgrade docker build action to @v2

Use proper arguments, separate login and code checkout actions into
separate steps.
