Skip to content

Commit 9b0d1b0

Browse files
committed
Updated worfkflow.
1 parent 2a71cc7 commit 9b0d1b0

File tree

1 file changed

+24
-20
lines changed

1 file changed

+24
-20
lines changed

.github/workflows/cd.yml

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ jobs:
2727
steps:
2828
- uses: actions/checkout@v5
2929

30+
- name: Set up QEMU
31+
uses: docker/setup-qemu-action@v3
32+
3033
- name: Set up Docker Buildx
3134
uses: docker/setup-buildx-action@v3
3235

@@ -88,24 +91,25 @@ jobs:
8891
echo "tags=$TAGS" >> $GITHUB_OUTPUT
8992
echo "Computed tags: $TAGS"
9093
91-
- name: Build and push Docker image
92-
run: |
93-
TAGS="${{ steps.compute.outputs.tags }}"
94-
95-
# Set image targets conditionally
96-
if [[ "${{ github.repository }}" == "umami-software/umami" ]]; then
97-
IMAGES=("umamisoftware/umami" "ghcr.io/${{ github.repository }}")
98-
else
99-
IMAGES=("ghcr.io/${{ github.repository }}")
100-
fi
94+
- name: Build and push to GHCR
95+
uses: mr-smithers-excellent/docker-build-push@v6
96+
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 }}
101104

102-
for IMAGE in "${IMAGES[@]}"; do
103-
echo "Building and pushing $IMAGE with tags: $TAGS"
104-
docker buildx build \
105-
--platform linux/amd64,linux/arm64 \
106-
--push \
107-
$(echo "$TAGS" | tr ',' '\n' | sed "s|^|--tag ${IMAGE}:|") \
108-
--cache-from type=gha \
109-
--cache-to type=gha,mode=max \
110-
.
111-
done
105+
- name: Build and push to Docker Hub
106+
if: github.repository == 'umami-software/umami'
107+
uses: mr-smithers-excellent/docker-build-push@v6
108+
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 }}

0 commit comments

Comments
 (0)