From fdbf511b11328915910152fcb2f337246378d6fd Mon Sep 17 00:00:00 2001 From: Quorinex Date: Mon, 11 May 2026 22:05:37 +0800 Subject: [PATCH] ci: fix image name must be lowercase for ghcr.io --- .github/workflows/docker.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 442430d..739b7fd 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -35,6 +35,10 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Set lowercase image name + id: image + run: echo "name=$(echo '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}' | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_OUTPUT" + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -50,7 +54,7 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + images: ${{ steps.image.outputs.name }} - name: Build and push by digest id: build @@ -60,7 +64,7 @@ jobs: platforms: ${{ matrix.platform }} push: ${{ github.event_name != 'pull_request' }} labels: ${{ steps.meta.outputs.labels }} - outputs: type=image,name=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=${{ github.event_name != 'pull_request' }} + outputs: type=image,name=${{ steps.image.outputs.name }},push-by-digest=true,name-canonical=true,push=${{ github.event_name != 'pull_request' }} cache-from: type=gha,scope=${{ matrix.platform }} cache-to: type=gha,mode=max,scope=${{ matrix.platform }} provenance: false @@ -100,6 +104,10 @@ jobs: path: /tmp/digests merge-multiple: true + - name: Set lowercase image name + id: image + run: echo "name=$(echo '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}' | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_OUTPUT" + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -114,7 +122,7 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + images: ${{ steps.image.outputs.name }} tags: | type=raw,value=latest,enable={{is_default_branch}} type=ref,event=branch @@ -124,10 +132,10 @@ jobs: - name: Create and push manifest run: | - DIGESTS=$(find /tmp/digests -name '*.txt' -exec cat {} \; | xargs -I{} echo "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@{}") + DIGESTS=$(find /tmp/digests -name '*.txt' -exec cat {} \; | xargs -I{} echo "${{ steps.image.outputs.name }}@{}") TAGS=$(echo "${{ steps.meta.outputs.tags }}" | xargs -I{} echo "--tag {}") docker buildx imagetools create $TAGS $DIGESTS - name: Inspect manifest run: | - docker buildx imagetools inspect ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }} + docker buildx imagetools inspect ${{ steps.image.outputs.name }}:${{ steps.meta.outputs.version }}