name: Build Docker image after release

on:
  release:
    types: [published]

env:
  TEST_TAG: ${{ github.repository }}:test

jobs:
  build:
    name: Build Docker image
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@v2
    - name: Docker meta
      id: meta
      uses: docker/metadata-action@v3
      with:
        images: ${{ github.repository }}
        tag-semver: |
          {{version}}
    - name: Login to DockerHub
      uses: docker/login-action@v1
      with:
        username: ${{ secrets.DOCKERHUB_USERNAME }}
        password: ${{ secrets.DOCKERHUB_TOKEN }}
    - name: Build and export to Docker
      id: build-test
      uses: docker/build-push-action@v2
      with:
        file: docker/Dockerfile
        load: true
        tags: ${{ env.TEST_TAG }}
        labels: ${{ steps.docker_meta.outputs.labels }}
    - name: Test
      id: test
      run: |
        ver=$(docker run --rm ${{ env.TEST_TAG }} --version)
        [[ "$ver" == "ggsashimi ${github_ref##*/}" ]]
      env:
        github_ref: ${{ github.ref }}
    - name: Build and push
      id: build
      uses: docker/build-push-action@v2
      with:
        file: docker/Dockerfile
        push: true
        tags: ${{ steps.docker_meta.outputs.tags }}
        labels: ${{ steps.docker_meta.outputs.labels }}
    - name: Image digest
      run: echo ${{ steps.docker_build.outputs.digest }}

name: Build Docker image after release

on:
  release:
    types: [published]

env:
  TEST_TAG: ${{ github.repository }}:test

jobs:
  build:
    name: Build Docker image
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@v2
    - name: Docker meta
      id: meta
      uses: docker/metadata-action@v3
      with:
        images: ${{ github.repository }}
        tag-semver: |
          {{version}}
    - name: Login to DockerHub
      uses: docker/login-action@v1
      with:
        username: ${{ secrets.DOCKERHUB_USERNAME }}
        password: ${{ secrets.DOCKERHUB_TOKEN }}
    - name: Build and export to Docker
      uses: docker/build-push-action@v2
      with:
        file: docker/Dockerfile
        load: true
        tags: ${{ env.TEST_TAG }}
        labels: ${{ steps.meta.outputs.labels }}
    - name: Test
      run: |
        ver=$(docker run --rm ${{ env.TEST_TAG }} --version)
        [[ "$ver" == "ggsashimi ${github_ref##*/}" ]]
      env:
        github_ref: ${{ github.ref }}3
    - name: Build and push
      id: build
      uses: docker/build-push-action@v2
      with:
        file: docker/Dockerfile
        push: true
        tags: ${{ steps.meta.outputs.tags }}
        labels: ${{ steps.meta.outputs.labels }}
    - name: Image digest
      run: echo ${{ steps.build.outputs.digest }}

Fix steps id in GithubActions Docker workflow
Fix steps id in GithubActions Docker workflow
