Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ concurrency:
group: deploy-production
cancel-in-progress: false

env:
IMAGE: ghcr.io/${{ github.repository }}

jobs:
deploy:
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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

Expand Down Expand Up @@ -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"
Loading