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 }}
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue