Skip to content

Commit d8a9ec2

Browse files
authored
Fix deploy workflow failing on no-op deploys (#173)
When the Docker image content is unchanged, Dokku's git:from-image exits non-zero with "No changes detected, skipping git commit." This treats that case as a success while still failing on real errors.
1 parent 2782e74 commit d8a9ec2

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

.github/workflows/deploy.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,12 @@ jobs:
104104
run: ssh-keyscan -p ${{ secrets.DOKKU_PORT }} -H ${{ secrets.DOKKU_HOST }} >> ~/.ssh/known_hosts
105105

106106
- name: Deploy to Dokku
107-
run: ssh -p ${{ secrets.DOKKU_PORT }} dokku@${{ secrets.DOKKU_HOST }} git:from-image lizard ${{ env.IMAGE_NAME }}:${{ env.GIT_SHA_SHORT }}
107+
run: |
108+
output=$(ssh -p ${{ secrets.DOKKU_PORT }} dokku@${{ secrets.DOKKU_HOST }} git:from-image lizard ${{ env.IMAGE_NAME }}:${{ env.GIT_SHA_SHORT }} 2>&1) && exit 0
109+
if echo "$output" | grep -q "No changes detected"; then
110+
echo "No changes detected, skipping deploy"
111+
exit 0
112+
else
113+
echo "$output"
114+
exit 1
115+
fi

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
5353

5454
### Fixed
5555

56+
- Deploy workflow failing when Dokku detects no image changes ("No changes detected, skipping git commit")
5657
- CI gate job passing when dependent jobs fail (`success()` at step level doesn't check `needs` context)
5758
- API key toggle not working (`td code { display: inline-block }` overrode `hidden` attribute)
5859
- Full API key truncated when revealed (scoped `max-width`/`overflow` to truncated element only)

0 commit comments

Comments
 (0)