diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a3bf2be..9f3d2c1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -84,7 +84,8 @@ jobs: images: ghcr.io/${{ github.repository }}/${{ matrix.image }} flavor: latest=false tags: | - type=raw,value=latest,enable={{is_default_branch}} + type=raw,value=edge,enable={{is_default_branch}} + type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/v') }} type=semver,pattern={{version}} type=sha,prefix= - uses: docker/build-push-action@v7 @@ -94,7 +95,7 @@ jobs: target: ${{ matrix.target }} platforms: linux/amd64,linux/arm64 push: ${{ github.event_name != 'pull_request' }} - build-args: VERSION=${{ github.sha }} + build-args: VERSION=${{ github.ref_type == 'tag' && format('{0}+{1}', github.ref_name, github.sha) || github.sha }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha,scope=${{ matrix.image }}