Nightly Badge zuverlässig: Vite Env VITE_BUILD_CHANNEL, Dockerfile ARG/ENV, CI Build-Args angepasst

This commit is contained in:
vibe-bot 2025-08-09 02:33:48 +02:00
parent 136312467d
commit 17b3737176
4 changed files with 9 additions and 6 deletions

View file

@ -41,7 +41,7 @@ jobs:
context: . context: .
push: true push: true
build-args: | build-args: |
REACT_APP_VERSION=${{ steps.docker_tag.outputs.tag == 'main' && 'stable' || 'nightly' }} VITE_BUILD_CHANNEL=${{ steps.docker_tag.outputs.tag == 'main' && 'stable' || 'nightly' }}
tags: | tags: |
${{ env.IMAGE_NAME }}:latest ${{ env.IMAGE_NAME }}:latest
${{ env.IMAGE_NAME }}:${{ github.sha }} ${{ env.IMAGE_NAME }}:${{ github.sha }}

View file

@ -6,9 +6,9 @@ WORKDIR /app/web
COPY web/package*.json ./ COPY web/package*.json ./
RUN npm install --no-audit --no-fund RUN npm install --no-audit --no-fund
COPY web/ . COPY web/ .
# Umgebungsvariable für React Build verfügbar machen # Umgebungsvariable für React Build verfügbar machen (Vite liest nur VITE_*)
ARG REACT_APP_VERSION=stable ARG VITE_BUILD_CHANNEL=stable
ENV REACT_APP_VERSION=$REACT_APP_VERSION ENV VITE_BUILD_CHANNEL=$VITE_BUILD_CHANNEL
RUN npm run build RUN npm run build
# --- Build server (npm) --- # --- Build server (npm) ---

View file

@ -179,8 +179,8 @@ export default function App() {
<div> <div>
<h1 className="text-4xl font-bold"> <h1 className="text-4xl font-bold">
Jukebox 420 Jukebox 420
{process.env.REACT_APP_VERSION === 'nightly' && ( {import.meta.env.VITE_BUILD_CHANNEL === 'nightly' && (
<span className="text-sm text-red-400 ml-2">Nightly</span> <span className="text-sm font-semibold ml-2" style={{ color: '#ff4d4f' }}>Nightly Build</span>
)} )}
</h1> </h1>
<p className="text-7xl font-bold mt-2">{clock}</p> <p className="text-7xl font-bold mt-2">{clock}</p>

View file

@ -339,6 +339,9 @@ header h1 {
color: inherit; color: inherit;
} }
/* Nightly Badge Farbe (Fallback) */
.nightly-badge { color: #ff4d4f; }
header p { header p {
margin: 0; margin: 0;
opacity: .9; opacity: .9;