Skip to content

Commit d46ce9a

Browse files
DAdjadjclaude
andcommitted
Fix CI tagging and add Docker layer caching
- Fix version tag collision when multiple builds run on the same day - Add GitHub Actions cache for Docker layers to speed up builds Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent e223a0f commit d46ce9a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

.github/workflows/docker-publish.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,16 @@ jobs:
2121
id: version
2222
run: |
2323
VERSION=$(date -u +%Y.%m.%d)
24-
# Check if this version tag already exists, add suffix if so
24+
# Count existing tags for today and increment
2525
EXISTING=$(git tag -l "v${VERSION}*" | wc -l)
2626
if [ "$EXISTING" -gt "0" ]; then
2727
VERSION="${VERSION}.$((EXISTING + 1))"
2828
fi
29+
# Make sure the tag doesn't already exist
30+
while git tag -l "v${VERSION}" | grep -q .; do
31+
EXISTING=$((EXISTING + 1))
32+
VERSION="$(date -u +%Y.%m.%d).${EXISTING}"
33+
done
2934
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
3035
3136
- name: Set up QEMU
@@ -46,6 +51,8 @@ jobs:
4651
context: .
4752
platforms: linux/amd64,linux/arm64,linux/arm/v7
4853
push: true
54+
cache-from: type=gha
55+
cache-to: type=gha,mode=max
4956
tags: |
5057
daalves/bridge-bank:latest
5158
daalves/bridge-bank:${{ steps.version.outputs.version }}

0 commit comments

Comments
 (0)