fix: sanitize branch name for Docker image tags
This commit is contained in:
@@ -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 }}
|
||||||
Reference in New Issue
Block a user