diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 9ebfa82..058c79b 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -41,7 +41,7 @@ jobs: context: . push: true 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: | ${{ env.IMAGE_NAME }}:latest ${{ env.IMAGE_NAME }}:${{ github.sha }} diff --git a/Dockerfile b/Dockerfile index 8ecf4e8..2864250 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,9 +6,9 @@ WORKDIR /app/web COPY web/package*.json ./ RUN npm install --no-audit --no-fund COPY web/ . -# Umgebungsvariable für React Build verfügbar machen -ARG REACT_APP_VERSION=stable -ENV REACT_APP_VERSION=$REACT_APP_VERSION +# Umgebungsvariable für React Build verfügbar machen (Vite liest nur VITE_*) +ARG VITE_BUILD_CHANNEL=stable +ENV VITE_BUILD_CHANNEL=$VITE_BUILD_CHANNEL RUN npm run build # --- Build server (npm) --- diff --git a/web/src/App.tsx b/web/src/App.tsx index 22ff5b9..79ed838 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -179,8 +179,8 @@ export default function App() {

Jukebox 420 - {process.env.REACT_APP_VERSION === 'nightly' && ( - Nightly + {import.meta.env.VITE_BUILD_CHANNEL === 'nightly' && ( + Nightly Build )}

{clock}

diff --git a/web/src/styles.css b/web/src/styles.css index fdf7055..05ef182 100644 --- a/web/src/styles.css +++ b/web/src/styles.css @@ -339,6 +339,9 @@ header h1 { color: inherit; } +/* Nightly Badge Farbe (Fallback) */ +.nightly-badge { color: #ff4d4f; } + header p { margin: 0; opacity: .9;