diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 058c79b..2b6614a 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -24,15 +24,19 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Generate Docker tag + - name: Generate Docker tag and version id: docker_tag run: | if [[ "${{ github.ref_name }}" == "main" ]]; then echo "tag=main" >> $GITHUB_OUTPUT + echo "version=1.0.0" >> $GITHUB_OUTPUT + echo "channel=stable" >> $GITHUB_OUTPUT else # Ersetze Slashes durch Bindestriche für gültige Docker Tags CLEAN_TAG=$(echo "${{ github.ref_name }}" | sed 's/\//-/g') echo "tag=$CLEAN_TAG" >> $GITHUB_OUTPUT + echo "version=1.0.0-nightly" >> $GITHUB_OUTPUT + echo "channel=nightly" >> $GITHUB_OUTPUT fi - name: Build and push @@ -41,7 +45,8 @@ jobs: context: . push: true build-args: | - VITE_BUILD_CHANNEL=${{ steps.docker_tag.outputs.tag == 'main' && 'stable' || 'nightly' }} + VITE_BUILD_CHANNEL=${{ steps.docker_tag.outputs.channel }} + VITE_APP_VERSION=${{ steps.docker_tag.outputs.version }} tags: | ${{ env.IMAGE_NAME }}:latest ${{ env.IMAGE_NAME }}:${{ github.sha }} diff --git a/Dockerfile b/Dockerfile index 2864250..7365c69 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,9 @@ RUN npm install --no-audit --no-fund COPY web/ . # Umgebungsvariable für React Build verfügbar machen (Vite liest nur VITE_*) ARG VITE_BUILD_CHANNEL=stable +ARG VITE_APP_VERSION=1.0.0 ENV VITE_BUILD_CHANNEL=$VITE_BUILD_CHANNEL +ENV VITE_APP_VERSION=$VITE_APP_VERSION RUN npm run build # --- Build server (npm) --- diff --git a/README.md b/README.md index 1b91dec..3301e76 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# 🎵 Jukebox 420 - Discord Soundboard +# 🎵 Jukebox 420 - Discord Soundboard v1.0.0 Ein modernes, feature-reiches Discord Soundboard mit Web-Frontend, Discord-Bot und Docker-Deployment. Perfekt für Gaming-Communities, Streamer und Discord-Server. -![Version](https://img.shields.io/badge/version-2.0-blue) +![Version](https://img.shields.io/badge/version-1.0.0-blue) ![Docker](https://img.shields.io/badge/docker-ready-green) ![Discord](https://img.shields.io/badge/discord-bot-purple) diff --git a/docker-compose.feature.yml b/docker-compose.feature.yml index 5f57f83..e5a0560 100644 --- a/docker-compose.feature.yml +++ b/docker-compose.feature.yml @@ -12,7 +12,8 @@ services: - CLIENT_ID=${CLIENT_ID} - GUILD_ID=${GUILD_ID} - ADMIN_PWD=${ADMIN_PWD} - - REACT_APP_VERSION=nightly + - VITE_BUILD_CHANNEL=nightly + - VITE_APP_VERSION=1.0.0-nightly volumes: - ./data/sounds:/data/sounds - ./data/uploads:/data/uploads diff --git a/docker-compose.yml b/docker-compose.yml index 9674592..fceeca2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,7 +7,8 @@ services: env_file: - .env environment: - - REACT_APP_VERSION=stable + - VITE_BUILD_CHANNEL=stable + - VITE_APP_VERSION=1.0.0 volumes: - ./data/sounds:/data/sounds restart: unless-stopped diff --git a/package.json b/package.json new file mode 100644 index 0000000..96fd141 --- /dev/null +++ b/package.json @@ -0,0 +1,22 @@ +{ + "name": "jukebox-vibe", + "version": "1.0.0", + "description": "Discord Soundboard mit Web-Interface", + "private": true, + "scripts": { + "dev": "vite", + "build": "tsc && vite build", + "preview": "vite preview" + }, + "dependencies": { + "react": "^18.2.0", + "react-dom": "^18.2.0" + }, + "devDependencies": { + "@types/react": "^18.2.0", + "@types/react-dom": "^18.2.0", + "@vitejs/plugin-react": "^4.0.0", + "typescript": "^5.0.0", + "vite": "^4.0.0" + } +} diff --git a/web/src/App.tsx b/web/src/App.tsx index 7daedf3..fc4a049 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -252,12 +252,15 @@ export default function App() {
-

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

+

+ Jukebox 420 +
+ v{import.meta.env.VITE_APP_VERSION || '1.0.0'} + {import.meta.env.VITE_BUILD_CHANNEL === 'nightly' && ( + • Nightly + )} +
+

{clock}