name: Publish Docker
on: [push]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master

    - name: Get release version
      id: get_version
      run: echo ::set-env name=RELEASE_VERSION::$(echo ${GITHUB_REF:10})

    - name: Publish to Registry
      uses: elgohr/Publish-Docker-Github-Action@master
      with:
        name: svengo/tor
        username: ${{ secrets.DOCKER_USERNAME }}
        password: ${{ secrets.DOCKER_PASSWORD }}
        tags: "latest,${{ env.RELEASE_VERSION }}"
        snapshot: true

name: Publish Docker
on:
  push:
    tags:
      - '*'

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master

    - name: Get release version
      id: get_version
      run: echo ::set-env name=RELEASE_VERSION::$(echo ${GITHUB_REF:10})

    - name: Publish to Registry
      uses: elgohr/Publish-Docker-Github-Action@master
      with:
        name: svengo/tor
        username: ${{ secrets.DOCKER_USERNAME }}
        password: ${{ secrets.DOCKER_PASSWORD }}
        tags: "latest,${{ env.RELEASE_VERSION }}"
        snapshot: true

Fix generate docker image only for tag
Fix generate docker image only for tag

See http://bit.ly/36atscS for the solution.
