diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 1b200e8..b3f85ae 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -61,9 +61,11 @@ jobs: # https://github.com/docker/metadata-action - name: Extract Docker metadata id: meta - uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=raw,value=latest,enable={{is_default_branch}} # Build and push Docker image with Buildx (don't push on PR) # https://github.com/docker/build-push-action @@ -73,9 +75,7 @@ jobs: with: context: . push: ${{ github.event_name != 'pull_request' }} - tags: | - ${{ steps.meta.outputs.tags }} - ${{ github.ref == 'refs/heads/master' && env.REGISTRY }}/{{ env.IMAGE_NAME }}:latest + tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha cache-to: type=gha,mode=max