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"