Fix: Docker Tag-Format für Feature Branches (Slash Bindestrich), GitHub Actions Pipeline korrigiert
This commit is contained in:
parent
17fa64c05a
commit
eac3cdecad
3 changed files with 16 additions and 5 deletions
13
.github/workflows/docker-build.yml
vendored
13
.github/workflows/docker-build.yml
vendored
|
|
@ -24,6 +24,17 @@ jobs:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
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
|
- name: Build and push
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
|
|
@ -32,5 +43,5 @@ jobs:
|
||||||
tags: |
|
tags: |
|
||||||
${{ env.IMAGE_NAME }}:latest
|
${{ env.IMAGE_NAME }}:latest
|
||||||
${{ env.IMAGE_NAME }}:${{ github.sha }}
|
${{ env.IMAGE_NAME }}:${{ github.sha }}
|
||||||
${{ env.IMAGE_NAME }}:${{ github.ref_name }}
|
${{ env.IMAGE_NAME }}:${{ steps.docker_tag.outputs.tag }}
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ docker-compose -f docker-compose.feature.yml up -d
|
||||||
|
|
||||||
### 4. In Portainer
|
### 4. In Portainer
|
||||||
- **Hauptversion:** `flex420/discordsoundbot-vib:latest` (Port 3000)
|
- **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
|
### 5. Mergen wenn bereit
|
||||||
```bash
|
```bash
|
||||||
|
|
@ -37,12 +37,12 @@ git branch -d feature/mein-experiment
|
||||||
|
|
||||||
## Docker Images
|
## Docker Images
|
||||||
- `:latest` - Hauptversion (main branch)
|
- `:latest` - Hauptversion (main branch)
|
||||||
- `:feature/nightly` - Feature Version
|
- `:feature-nightly` - Feature Version
|
||||||
- `:main` - Explizit main branch
|
- `:main` - Explizit main branch
|
||||||
- `:sha-abc123` - Spezifischer Commit
|
- `:sha-abc123` - Spezifischer Commit
|
||||||
|
|
||||||
## Portainer Setup
|
## Portainer Setup
|
||||||
1. **Hauptcontainer:** Port 3000, Image `:latest`
|
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
|
3. **Testing:** Feature auf Port 3001 testen
|
||||||
4. **Deployment:** Wenn gut, Feature in main mergen
|
4. **Deployment:** Wenn gut, Feature in main mergen
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ version: '3.8'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
app-feature:
|
app-feature:
|
||||||
image: flex420/discordsoundbot-vib:feature/nightly
|
image: flex420/discordsoundbot-vib:feature-nightly
|
||||||
container_name: jukebox-feature
|
container_name: jukebox-feature
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue