From 8d5d104a6ac6777e568fe8f7b3f5bd78b981ae53 Mon Sep 17 00:00:00 2001 From: EOEboh Date: Tue, 28 Jul 2026 13:18:13 +0100 Subject: [PATCH] fix(ci): lowercase the GHCR image name Container registry names must be lowercase, but github.repository is EOEboh/hookdrop, so the first deploy failed at the build with "repository name must be lowercase". The name is now folded to lowercase when it is computed. The failure was harmless: the image is pushed before anything on the server is touched, so the running container was never involved. --- .github/workflows/deploy.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 19d2e86..1d90d6f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -16,8 +16,6 @@ concurrency: group: deploy-production cancel-in-progress: false -env: - IMAGE: ghcr.io/${{ github.repository }} jobs: deploy: @@ -37,6 +35,8 @@ jobs: id: meta run: | echo "sha=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT" + # Registry names must be lowercase; the repo owner is not. + echo "image=ghcr.io/$(echo '${{ github.repository }}' | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_OUTPUT" echo "Deploying $(git rev-parse --short HEAD) — $(git log -1 --pretty=%s)" # Deploy only what passes. Actions does not gate workflow_dispatch on @@ -67,8 +67,8 @@ jobs: platforms: linux/amd64 push: true tags: | - ${{ env.IMAGE }}:${{ steps.meta.outputs.sha }} - ${{ env.IMAGE }}:latest + ${{ steps.meta.outputs.image }}:${{ steps.meta.outputs.sha }} + ${{ steps.meta.outputs.image }}:latest cache-from: type=gha cache-to: type=gha,mode=max @@ -87,7 +87,7 @@ jobs: TAG: ${{ steps.meta.outputs.sha }} run: | ssh -o BatchMode=yes "${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }}" \ - "IMAGE='${{ env.IMAGE }}' TAG='$TAG' bash -s" <<'REMOTE' + "IMAGE='${{ steps.meta.outputs.image }}' TAG='$TAG' bash -s" <<'REMOTE' set -euo pipefail cd /opt/hookdrop @@ -147,7 +147,7 @@ jobs: echo "### Deploy ${{ job.status }}" echo "" echo "- ref: \`${{ inputs.ref }}\`" - echo "- image: \`${{ env.IMAGE }}:${{ steps.meta.outputs.sha }}\`" + echo "- image: \`${{ steps.meta.outputs.image }}:${{ steps.meta.outputs.sha }}\`" echo "" echo "Roll back by re-running this workflow against the previous commit." } >> "$GITHUB_STEP_SUMMARY"