From d5e9b376fcf9c0fc8683e9e4d0591382c6a3c3e0 Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Wed, 24 Jun 2026 15:11:55 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=B3=20ci:=20Build=20&=20Publish=20Vers?= =?UTF-8?q?ioned=20Image=20on=20Release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Docker publish workflow only triggered on `main` pushes and tagged images with `:` 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 `:` (unchanged behavior) `latest` continues to track `main` rather than the latest release, so the docker-compose `:latest` reference is unaffected. --- .github/workflows/docker-publish.yml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 96a21d1..a1d7628 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -2,6 +2,8 @@ name: Docker Image Publish on: workflow_dispatch: + release: + types: [published] push: branches: - main @@ -37,13 +39,24 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - 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}} + - name: Build and push uses: docker/build-push-action@v6 with: context: . file: Dockerfile push: true - tags: | - ghcr.io/clickhouse/librechat-admin-panel:${{ github.sha }} - ghcr.io/clickhouse/librechat-admin-panel:latest + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} platforms: linux/amd64,linux/arm64