Docker build and push using github: invalid reference format

I want to build my image and push it to dockerhub using github actions.This is my repo

And this is how I want to do my job:

name: ci

on:
  push:
    branches:
      - 'master'

jobs:
  docker:
    runs-on: ubuntu-latest
    steps:
      -
        name: Checkout
        uses: actions/[email protected]
      -
        name: Set up QEMU
        uses: docker/[email protected]
      -
        name: Set up Docker Buildx
        uses: docker/[email protected]
      -
        name: Login to DockerHub
        uses: docker/[email protected]
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_PASSWORD }}
      -
        name: Build and push
        uses: docker/[email protected]
        with:
          context: .
          load: true
          tags: shirzadi/ehsan:latest
      -
        name: Push it!
        run: docker push ${{ env.IMAGE }}:${{ env.GIT_SHA }}

And this is the result:
invalid reference format

Source: Docker Questions

LEAVE A COMMENT