Show the release version in the sidebar footer
Baked at image build time: web/Dockerfile takes ARG SUPERBRAIN_VERSION (default dev) into NEXT_PUBLIC_SUPERBRAIN_VERSION; the release workflow passes the tag, README Option B gains the matching --build-arg, and local compose builds show 'dev build'. Rendered muted under the sidebar footer when expanded, so any deployment can be identified from the UI alone.
This commit is contained in:
@@ -117,6 +117,8 @@ jobs:
|
|||||||
file: web/Dockerfile
|
file: web/Dockerfile
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
push: true
|
push: true
|
||||||
|
# Bakes the release tag into the client bundle (sidebar footer).
|
||||||
|
build-args: SUPERBRAIN_VERSION=${{ github.ref_name }}
|
||||||
tags: |
|
tags: |
|
||||||
federatedcomputer/superbrain-web:${{ github.ref_name }}
|
federatedcomputer/superbrain-web:${{ github.ref_name }}
|
||||||
federatedcomputer/superbrain-web:latest
|
federatedcomputer/superbrain-web:latest
|
||||||
|
|||||||
@@ -490,6 +490,7 @@ V=1.2.3
|
|||||||
docker buildx build --platform linux/amd64,linux/arm64 --push \
|
docker buildx build --platform linux/amd64,linux/arm64 --push \
|
||||||
-t federatedcomputer/superbrain-app:$V -t federatedcomputer/superbrain-app:latest .
|
-t federatedcomputer/superbrain-app:$V -t federatedcomputer/superbrain-app:latest .
|
||||||
docker buildx build --platform linux/amd64,linux/arm64 --push \
|
docker buildx build --platform linux/amd64,linux/arm64 --push \
|
||||||
|
--build-arg SUPERBRAIN_VERSION=$V \
|
||||||
-t federatedcomputer/superbrain-web:$V -t federatedcomputer/superbrain-web:latest web
|
-t federatedcomputer/superbrain-web:$V -t federatedcomputer/superbrain-web:latest web
|
||||||
docker buildx build --platform linux/amd64,linux/arm64 --push \
|
docker buildx build --platform linux/amd64,linux/arm64 --push \
|
||||||
--build-context deploy=deploy/federated \
|
--build-context deploy=deploy/federated \
|
||||||
|
|||||||
+5
-1
@@ -8,7 +8,11 @@ FROM node:22.23.3-alpine3.24 AS build
|
|||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=deps /app/node_modules ./node_modules
|
COPY --from=deps /app/node_modules ./node_modules
|
||||||
COPY . .
|
COPY . .
|
||||||
ENV NEXT_TELEMETRY_DISABLED=1
|
# Release version baked into the client bundle (sidebar footer). The release
|
||||||
|
# workflow passes the tag as SUPERBRAIN_VERSION; every other build keeps the
|
||||||
|
# default and the UI shows "dev build".
|
||||||
|
ARG SUPERBRAIN_VERSION=dev
|
||||||
|
ENV NEXT_TELEMETRY_DISABLED=1 NEXT_PUBLIC_SUPERBRAIN_VERSION=$SUPERBRAIN_VERSION
|
||||||
RUN yarn build
|
RUN yarn build
|
||||||
|
|
||||||
FROM node:22.23.3-alpine3.24 AS runtime
|
FROM node:22.23.3-alpine3.24 AS runtime
|
||||||
|
|||||||
@@ -3,6 +3,12 @@
|
|||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import { useRouter, useSearchParams } from 'next/navigation'
|
import { useRouter, useSearchParams } from 'next/navigation'
|
||||||
import { Suspense, useCallback, useEffect, useRef, useState, useSyncExternalStore } from 'react'
|
import { Suspense, useCallback, useEffect, useRef, useState, useSyncExternalStore } from 'react'
|
||||||
|
|
||||||
|
// Release version baked into the client bundle at image build time
|
||||||
|
// (web/Dockerfile ARG SUPERBRAIN_VERSION; CI passes the tag, local builds
|
||||||
|
// keep "dev"). Shown in the sidebar footer so any deployment can be
|
||||||
|
// identified from the UI alone.
|
||||||
|
const APP_VERSION = process.env.NEXT_PUBLIC_SUPERBRAIN_VERSION || ''
|
||||||
import { cn } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
import {
|
import {
|
||||||
Calendar, Tags, Users, Kanban, Link2, Settings, ChevronLeft, ChevronRight, ChevronDown,
|
Calendar, Tags, Users, Kanban, Link2, Settings, ChevronLeft, ChevronRight, ChevronDown,
|
||||||
@@ -110,6 +116,11 @@ export function Sidebar({ open, onToggle, onQuickFind, pathname, isAdmin = false
|
|||||||
<Button variant="ghost" size="icon-sm" onClick={onToggle} className="w-full" aria-label={open ? 'Collapse sidebar' : 'Expand sidebar'}>
|
<Button variant="ghost" size="icon-sm" onClick={onToggle} className="w-full" aria-label={open ? 'Collapse sidebar' : 'Expand sidebar'}>
|
||||||
{open ? <ChevronLeft className="h-4 w-4" /> : <ChevronRight className="h-4 w-4" />}
|
{open ? <ChevronLeft className="h-4 w-4" /> : <ChevronRight className="h-4 w-4" />}
|
||||||
</Button>
|
</Button>
|
||||||
|
{open && APP_VERSION && (
|
||||||
|
<p className="px-3 pt-0.5 text-[10px] text-muted-foreground/70 select-none" title={`Superbrain ${APP_VERSION}`}>
|
||||||
|
{APP_VERSION === 'dev' ? 'dev build' : `v${APP_VERSION}`}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</aside>
|
</aside>
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user