From b01f9ced90d27bb5fac21d0f52dadfeaa9d4e7b0 Mon Sep 17 00:00:00 2001 From: Sebastian Kunze Date: Mon, 21 Nov 2022 16:50:07 +0100 Subject: [PATCH] Fix `repository name must be lowercase` on docker build --- .github/workflows/container-image.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/container-image.yml b/.github/workflows/container-image.yml index 5ddfb7d0c9..9add41f755 100644 --- a/.github/workflows/container-image.yml +++ b/.github/workflows/container-image.yml @@ -24,6 +24,9 @@ on: required: true type: string +env: + REGISTRY: ghcr.io + jobs: build-push-generic-container-image: runs-on: ubuntu-latest @@ -34,10 +37,14 @@ jobs: id: date run: echo "::set-output name=date::$(date +'%Y%m%d')" + - name: Normalise image name + run: | + echo IMAGE_NAME=$(echo '${{ github.repository_owner }}/${{ inputs.image_name }}' | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV + - name: Login to GHCR uses: docker/login-action@v2 with: - registry: ghcr.io + registry: ${{ env.REGISTRY }} username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} @@ -47,5 +54,5 @@ jobs: context: ${{ inputs.docker_context }} push: true tags: | - ghcr.io/${{ github.repository_owner }}/${{ inputs.image_name }}:latest - ghcr.io/${{ github.repository_owner }}/${{ inputs.image_name }}:${{ steps.date.outputs.date }} + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.date.outputs.date }}