Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

New docker workflow.

Mike Cao6ba9c1c40c39
diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml
index 6569954ea..a9509bce0 100644
--- a/.github/workflows/cd.yml
+++ b/.github/workflows/cd.yml
@@ -78,15 +78,23 @@ jobs:
echo "Computed tags: $TAGS"
- name: Build and push Docker image
- id: build
- uses: docker/build-push-action@v6
- with:
- context: .
- push: true
- platforms: linux/amd64,linux/arm64
- cache-from: type=gha
- cache-to: type=gha,mode=max
- provenance: false
- tags: |
- ghcr.io/${{ github.repository }}:${{ steps.compute.outputs.tags }}
- ${{ github.repository == 'umami-software/umami' && format('umamisoftware/umami:{0}', steps.compute.outputs.tags) || '' }}
+ run: |
+ TAGS="${{ steps.compute.outputs.tags }}"
+
+ # Set image targets conditionally
+ if [[ "${{ github.repository }}" == "umami-software/umami" ]]; then
+ IMAGES=("umamisoftware/umami" "ghcr.io/${{ github.repository }}")
+ else
+ IMAGES=("ghcr.io/${{ github.repository }}")
+ fi
+
+ for IMAGE in "${IMAGES[@]}"; do
+ echo "Building and pushing $IMAGE with tags: $TAGS"
+ docker buildx build \
+ --platform linux/amd64,linux/arm64 \
+ --push \
+ $(echo "$TAGS" | tr ',' '\n' | sed "s|^|--tag ${IMAGE}:|") \
+ --cache-from type=gha \
+ --cache-to type=gha,mode=max \
+ .
+ done