Skip to content

Commit

Permalink
fix: Cambio en la variable de docker hub
Browse files Browse the repository at this point in the history
  • Loading branch information
Bryyyan93 committed Nov 14, 2024
1 parent 572c945 commit 76b29ee
Showing 1 changed file with 15 additions and 30 deletions.
45 changes: 15 additions & 30 deletions .github/workflows/build_and_push.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
name: Build and Push

#on:
# release:
# types:
# - published
on:
workflow_run:
workflows: ["Release"] # Nombre exacto del workflow release.yml
Expand Down Expand Up @@ -34,7 +30,7 @@ jobs:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-pip-
- name: Get the latest release tag
id: get_latest_tag
Expand All @@ -57,7 +53,8 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Docker Login
# Login to GitHub Container Registry (GHCR)
- name: Docker Login to GHCR
uses: docker/login-action@v1
id: configure-login-ghcr
with:
Expand All @@ -72,44 +69,32 @@ jobs:
with:
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata
id: meta
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/${{ github.repository }}/${{ env.COMPONENT_NAME }}
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.COMPONENT_NAME }}
tags: |
type=semver,pattern={{raw}},value=${{ env.COMPONENT_VERSION }}
type=raw,value=latest
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push to GHCR
uses: docker/build-push-action@v5
with:
push: true
platforms: linux/amd64,linux/arm64,linux/arm/v7
file: ./Dockerfile # Apunta al Dockerfile en la raíz
context: . # Usa la raíz como contexto
file: ./Dockerfile
context: .
tags: |
ghcr.io/${{ github.repository_owner | toLower }}/liberando-productos-practica:${{ env.COMPONENT_VERSION | toLower }}
ghcr.io/${{ github.repository_owner | toLower }}/liberando-productos-practica:${{ env.COMPONENT_VERSION }}
ghcr.io/${{ github.repository_owner | toLower }}/liberando-productos-practica:latest
labels: ${{ steps.meta.outputs.labels }}
build-args: |
VERSION: ${{ env.COMPONENT_VERSION }}
build-args:
VERSION=${{ env.COMPONENT_VERSION }}

- name: Build and push to Docker Hub
uses: docker/build-push-action@v5
with:
push: true
platforms: linux/amd64,linux/arm64,linux/arm/v7
file: ./Dockerfile # Apunta al Dockerfile en la raíz
context: . # Usa la raíz como contexto
file: ./Dockerfile
context: .
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.COMPONENT_NAME }}:${{ env.COMPONENT_VERSION }}
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.COMPONENT_NAME }}:latest
${{ secrets.DOCKER_USERNAME | toLower }}/liberando-productos-practica:${{ env.COMPONENT_VERSION }}
${{ secrets.DOCKER_USERNAME | toLower }}/liberando-productos-practica:latest
labels: ${{ steps.meta.outputs.labels }}
build-args: |
VERSION: ${{ env.COMPONENT_VERSION }}
build-args:
VERSION=${{ env.COMPONENT_VERSION }}

0 comments on commit 76b29ee

Please sign in to comment.