Skip to content

🐳 ci: Build & Publish Versioned Image on Release#90

Merged
danny-avila merged 1 commit into
mainfrom
claude/release-tag-build
Jun 24, 2026
Merged

🐳 ci: Build & Publish Versioned Image on Release#90
danny-avila merged 1 commit into
mainfrom
claude/release-tag-build

Conversation

@danny-avila

Copy link
Copy Markdown
Contributor

Summary

Publishing a GitHub release (e.g. v1.0.0) currently builds no Docker image: the Docker Image Publish workflow only triggers on main pushes and tags images with :<sha> and :latest.

This adds release-driven, versioned image builds.

Changes

  • New trigger: release: published (in addition to the existing workflow_dispatch and main push triggers).
  • Tag generation via docker/metadata-action:
Event Image tags pushed
Release v1.0.0 published :1.0.0, :1.0, :1
Push to main :latest, :<full-sha> (unchanged)

latest deliberately keeps tracking main (not the latest release), so the existing docker-compose.yml :latest reference is unaffected. The full-<sha> tag format is preserved.

Note on the existing v1.0.0 release

The v1.0.0 tag points to a commit that predates this workflow, so merging this will not retroactively build the v1.0.0 image — GitHub runs the workflow version that exists at the released commit. The first versioned build will happen on the next release cut after this merges (or by re-pointing v1.0.0 to a commit that includes this workflow). See the PR discussion for options.

🤖 Generated with Claude Code

The Docker publish workflow only triggered on `main` pushes and tagged
images with `:<sha>` and `:latest`, so publishing a GitHub release (e.g.
v1.0.0) produced no versioned image.

- Trigger the workflow on `release: published` (keeps `workflow_dispatch`
  and the existing `main` push trigger).
- Use `docker/metadata-action` to derive tags:
  - Releases → `:1.0.0`, `:1.0`, `:1` (semver)
  - `main` pushes → `:latest` + full `:<sha>` (unchanged behavior)

`latest` continues to track `main` rather than the latest release, so the
docker-compose `:latest` reference is unaffected.
Comment on lines +42 to +52
- name: Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/clickhouse/librechat-admin-panel
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=raw,value=latest,enable={{is_default_branch}}
type=sha,format=long,prefix=,enable={{is_default_branch}}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 High workflows/docker-publish.yml:42

The docker/metadata-action config auto-generates a latest tag for every type=semver rule, so publishing release v1.0.0 will overwrite the existing :latest image (which should track main branch builds) with the release image. The explicit type=raw,value=latest,enable={{is_default_branch}} rule then creates a duplicate tag. Consider setting flavor: latest=false to disable the implicit latest tag from semver rules, ensuring :latest only tracks main builds.

       - name: Docker metadata
         id: meta
         uses: docker/metadata-action@v5
         with:
           images: ghcr.io/clickhouse/librechat-admin-panel
+          flavor: latest=false
           tags: |
             type=semver,pattern={{version}}
             type=semver,pattern={{major}}.{{minor}}
             type=semver,pattern={{major}}
             type=raw,value=latest,enable={{is_default_branch}}
             type=sha,format=long,prefix=,enable={{is_default_branch}}
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @.github/workflows/docker-publish.yml around lines 42-52:

The `docker/metadata-action` config auto-generates a `latest` tag for every `type=semver` rule, so publishing release `v1.0.0` will overwrite the existing `:latest` image (which should track `main` branch builds) with the release image. The explicit `type=raw,value=latest,enable={{is_default_branch}}` rule then creates a duplicate tag. Consider setting `flavor: latest=false` to disable the implicit `latest` tag from semver rules, ensuring `:latest` only tracks `main` builds.

@danny-avila danny-avila merged commit bf4b3b1 into main Jun 24, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants