From 81059d599e1719e204e5a0a25ea2b6f336593004 Mon Sep 17 00:00:00 2001 From: Rumen Nikiforov Date: Wed, 11 Jan 2023 15:46:43 +0200 Subject: [PATCH] Unhardcoding cd-docker-hub.yml (#316) --- .github/workflows/cd-docker-hub.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cd-docker-hub.yml b/.github/workflows/cd-docker-hub.yml index f4bfb02f0..ff1e06623 100644 --- a/.github/workflows/cd-docker-hub.yml +++ b/.github/workflows/cd-docker-hub.yml @@ -16,8 +16,6 @@ on: types: [ published ] env: - REGISTRY: ajustesen - IMAGE_NAME: ${{ github.repository }} PLATFORMS: linux/amd64,linux/arm64,linux/arm/v7 jobs: @@ -40,11 +38,15 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} + - id: docker-image-to-lowercase + name: Convert Docker image to lower case + run: echo "DOCKER_IMAGE=$(echo ${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV + - name: Extract metadata (tags, labels) for Docker id: meta uses: docker/metadata-action@v4 with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + images: ${{ env.DOCKER_IMAGE }} - name: Build and push image to Docker Hub uses: docker/build-push-action@v3 @@ -52,5 +54,5 @@ jobs: context: . push: true platforms: ${{ env.PLATFORMS }} - tags: ajustesen/speedtest-tracker:latest + tags: ${{ env.DOCKER_IMAGE }}:latest labels: ${{ steps.meta.outputs.labels }}