Skip to content

Commit 860e639

Browse files
committed
Updated Docker build.
1 parent 9b0d1b0 commit 860e639

File tree

1 file changed

+36
-24
lines changed

1 file changed

+36
-24
lines changed

.github/workflows/cd.yml

Lines changed: 36 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -65,51 +65,63 @@ jobs:
6565
VERSION=""
6666
fi
6767
68-
TAGS=""
68+
GHCR_TAGS=""
69+
DOCKER_TAGS=""
6970
7071
if [[ -n "$VERSION" ]]; then
7172
MAJOR=$(echo "$VERSION" | cut -d. -f1)
7273
MINOR=$(echo "$VERSION" | cut -d. -f2)
7374
7475
if [[ "$VERSION" == *-* ]]; then
7576
# prerelease: only version tag
76-
TAGS="$VERSION"
77+
GHCR_TAGS="ghcr.io/${{ github.repository }}:$VERSION"
78+
DOCKER_TAGS="umamisoftware/umami:$VERSION"
7779
else
7880
# stable release: version + hierarchy
79-
TAGS="$VERSION,${MAJOR}.${MINOR},${MAJOR},postgresql-latest"
80-
81+
GHCR_TAGS="ghcr.io/${{ github.repository }}:$VERSION"
82+
GHCR_TAGS="$GHCR_TAGS,ghcr.io/${{ github.repository }}:${MAJOR}.${MINOR}"
83+
GHCR_TAGS="$GHCR_TAGS,ghcr.io/${{ github.repository }}:${MAJOR}"
84+
GHCR_TAGS="$GHCR_TAGS,ghcr.io/${{ github.repository }}:postgresql-latest"
85+
86+
DOCKER_TAGS="umamisoftware/umami:$VERSION"
87+
DOCKER_TAGS="$DOCKER_TAGS,umamisoftware/umami:${MAJOR}.${MINOR}"
88+
DOCKER_TAGS="$DOCKER_TAGS,umamisoftware/umami:${MAJOR}"
89+
DOCKER_TAGS="$DOCKER_TAGS,umamisoftware/umami:postgresql-latest"
90+
8191
# Add latest tag based on trigger and input
8292
if [[ "$REF_TYPE" == "tag" ]] || [[ "$INCLUDE_LATEST" == "true" ]]; then
83-
TAGS="${TAGS},latest"
93+
GHCR_TAGS="$GHCR_TAGS,ghcr.io/${{ github.repository }}:latest"
94+
DOCKER_TAGS="$DOCKER_TAGS,umamisoftware/umami:latest"
8495
fi
8596
fi
8697
else
8798
# Non-tag build (e.g. from main branch)
88-
TAGS="${REF_NAME}"
99+
GHCR_TAGS="ghcr.io/${{ github.repository }}:${REF_NAME}"
100+
DOCKER_TAGS="umamisoftware/umami:${REF_NAME}"
89101
fi
90102
91-
echo "tags=$TAGS" >> $GITHUB_OUTPUT
92-
echo "Computed tags: $TAGS"
103+
echo "ghcr_tags=$GHCR_TAGS" >> $GITHUB_OUTPUT
104+
echo "docker_tags=$DOCKER_TAGS" >> $GITHUB_OUTPUT
105+
echo "Computed GHCR tags: $GHCR_TAGS"
106+
echo "Computed Docker Hub tags: $DOCKER_TAGS"
93107
94108
- name: Build and push to GHCR
95-
uses: mr-smithers-excellent/docker-build-push@v6
109+
uses: docker/build-push-action@v5
96110
with:
97-
image: ${{ github.repository }}
98-
tags: ${{ steps.compute.outputs.tags }}
99-
registry: ghcr.io
100-
multiPlatform: true
101-
platform: linux/amd64,linux/arm64
102-
username: ${{ github.actor }}
103-
password: ${{ secrets.GITHUB_TOKEN }}
111+
context: .
112+
platforms: linux/amd64,linux/arm64
113+
push: true
114+
tags: ${{ steps.compute.outputs.ghcr_tags }}
115+
cache-from: type=gha
116+
cache-to: type=gha,mode=max
104117

105118
- name: Build and push to Docker Hub
106119
if: github.repository == 'umami-software/umami'
107-
uses: mr-smithers-excellent/docker-build-push@v6
120+
uses: docker/build-push-action@v5
108121
with:
109-
image: umamisoftware/umami
110-
tags: ${{ steps.compute.outputs.tags }}
111-
registry: docker.io
112-
multiPlatform: true
113-
platform: linux/amd64,linux/arm64
114-
username: ${{ secrets.DOCKER_USERNAME }}
115-
password: ${{ secrets.DOCKER_PASSWORD }}
122+
context: .
123+
platforms: linux/amd64,linux/arm64
124+
push: true
125+
tags: ${{ steps.compute.outputs.docker_tags }}
126+
cache-from: type=gha
127+
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)