diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index 4da0661b..688ed136 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -46,7 +46,12 @@ jobs: id: meta uses: docker/metadata-action@v4 with: - images: ${{ env.REGISTRY }}/$(echo ${{ env.IMAGE_NAME }} | tr '[:upper:]' '[:lower:]') + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=sha + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} - name: Build and also push Dockerimage id: build-and-push @@ -54,8 +59,5 @@ jobs: with: context: . push: true - tags: | - ${{ env.REGISTRY }}/$(echo ${{ env.IMAGE_NAME }} | tr '[:upper:]' '[:lower:]'):${{ github.sha }} - ${{ env.REGISTRY }}/$(echo ${{ env.IMAGE_NAME }} | tr '[:upper:]' '[:lower:]'):latest - ${{ github.event_name == 'push' && github.ref_type == 'tag' && format('{0}/{1}', env.REGISTRY, env.IMAGE_NAME) | toLowerCase }}:${{ github.ref_name }} + tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }}