diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 3f07c94c..58be0c07 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -8,7 +8,6 @@ on: env: REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository | lowercase }} jobs: build-and-push-image: @@ -28,9 +27,16 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v3 + with: + images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ github.event.repository.name }} + - name: Build and push Docker image uses: docker/build-push-action@v2 with: context: . push: true - tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}