fix: sanitize branch name for Docker image tags

This commit is contained in:
2026-04-20 09:27:01 +02:00
parent f89116ca2e
commit e150e8e5e7
+7 -2
View File
@@ -45,10 +45,15 @@ jobs:
username: ${{ github.actor }} username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}
- name: Preparar tag de imagen
run: |
TAG=$(echo "${{ github.ref_name }}" | sed 's/\//-/g')
echo "IMAGE_TAG=$TAG" >> $GITHUB_ENV
- name: Build y Push - name: Build y Push
uses: docker/build-push-action@v6 uses: docker/build-push-action@v6
with: with:
context: . context: .
push: true push: true
# Aquí usamos el nombre de la rama dinámicamente # Sanitizamos el nombre de la rama (reemplazamos / por -)
tags: ghcr.io/dsaub/proyecto-mvc:${{ github.ref_name }} tags: ghcr.io/dsaub/proyecto-mvc:${{ env.IMAGE_TAG }}