From eac3cdecad8a2c5f2090f6b6f0db8e522428673f Mon Sep 17 00:00:00 2001 From: vibe-bot Date: Sat, 9 Aug 2025 02:14:08 +0200 Subject: [PATCH] =?UTF-8?q?Fix:=20Docker=20Tag-Format=20f=C3=BCr=20Feature?= =?UTF-8?q?=20Branches=20(Slash=20=20Bindestrich),=20GitHub=20Actions=20Pi?= =?UTF-8?q?peline=20korrigiert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docker-build.yml | 13 ++++++++++++- FEATURE_BRANCH.md | 6 +++--- docker-compose.feature.yml | 2 +- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 7d36e3e..6da32a9 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -24,6 +24,17 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Generate Docker tag + id: docker_tag + run: | + if [[ "${{ github.ref_name }}" == "main" ]]; then + echo "tag=main" >> $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 + fi + - name: Build and push uses: docker/build-push-action@v5 with: @@ -32,5 +43,5 @@ jobs: tags: | ${{ env.IMAGE_NAME }}:latest ${{ env.IMAGE_NAME }}:${{ github.sha }} - ${{ env.IMAGE_NAME }}:${{ github.ref_name }} + ${{ env.IMAGE_NAME }}:${{ steps.docker_tag.outputs.tag }} platforms: linux/amd64 diff --git a/FEATURE_BRANCH.md b/FEATURE_BRANCH.md index 77249c7..e895340 100644 --- a/FEATURE_BRANCH.md +++ b/FEATURE_BRANCH.md @@ -24,7 +24,7 @@ docker-compose -f docker-compose.feature.yml up -d ### 4. In Portainer - **Hauptversion:** `flex420/discordsoundbot-vib:latest` (Port 3000) -- **Feature Version:** `flex420/discordsoundbot-vib:feature/nightly` (Port 3001) +- **Feature Version:** `flex420/discordsoundbot-vib:feature-nightly` (Port 3001) ### 5. Mergen wenn bereit ```bash @@ -37,12 +37,12 @@ git branch -d feature/mein-experiment ## Docker Images - `:latest` - Hauptversion (main branch) -- `:feature/nightly` - Feature Version +- `:feature-nightly` - Feature Version - `:main` - Explizit main branch - `:sha-abc123` - Spezifischer Commit ## Portainer Setup 1. **Hauptcontainer:** Port 3000, Image `:latest` -2. **Feature Container:** Port 3001, Image `:feature/nightly` +2. **Feature Container:** Port 3001, Image `:feature-nightly` 3. **Testing:** Feature auf Port 3001 testen 4. **Deployment:** Wenn gut, Feature in main mergen diff --git a/docker-compose.feature.yml b/docker-compose.feature.yml index 32c46ed..909cee5 100644 --- a/docker-compose.feature.yml +++ b/docker-compose.feature.yml @@ -2,7 +2,7 @@ version: '3.8' services: app-feature: - image: flex420/discordsoundbot-vib:feature/nightly + image: flex420/discordsoundbot-vib:feature-nightly container_name: jukebox-feature restart: unless-stopped ports: