Updated worfkflow.

This commit is contained in:
Mike Cao 2025-12-11 19:31:36 -08:00
parent 2a71cc721b
commit 9b0d1b092e

View file

@ -27,6 +27,9 @@ jobs:
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v5
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
@ -88,24 +91,25 @@ jobs:
echo "tags=$TAGS" >> $GITHUB_OUTPUT echo "tags=$TAGS" >> $GITHUB_OUTPUT
echo "Computed tags: $TAGS" echo "Computed tags: $TAGS"
- name: Build and push Docker image - name: Build and push to GHCR
run: | uses: mr-smithers-excellent/docker-build-push@v6
TAGS="${{ steps.compute.outputs.tags }}" with:
image: ${{ github.repository }}
tags: ${{ steps.compute.outputs.tags }}
registry: ghcr.io
multiPlatform: true
platform: linux/amd64,linux/arm64
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Set image targets conditionally - name: Build and push to Docker Hub
if [[ "${{ github.repository }}" == "umami-software/umami" ]]; then if: github.repository == 'umami-software/umami'
IMAGES=("umamisoftware/umami" "ghcr.io/${{ github.repository }}") uses: mr-smithers-excellent/docker-build-push@v6
else with:
IMAGES=("ghcr.io/${{ github.repository }}") image: umamisoftware/umami
fi tags: ${{ steps.compute.outputs.tags }}
registry: docker.io
for IMAGE in "${IMAGES[@]}"; do multiPlatform: true
echo "Building and pushing $IMAGE with tags: $TAGS" platform: linux/amd64,linux/arm64
docker buildx build \ username: ${{ secrets.DOCKER_USERNAME }}
--platform linux/amd64,linux/arm64 \ password: ${{ secrets.DOCKER_PASSWORD }}
--push \
$(echo "$TAGS" | tr ',' '\n' | sed "s|^|--tag ${IMAGE}:|") \
--cache-from type=gha \
--cache-to type=gha,mode=max \
.
done