|
27 | 27 | steps: |
28 | 28 | - uses: actions/checkout@v5 |
29 | 29 |
|
| 30 | + - name: Set up QEMU |
| 31 | + uses: docker/setup-qemu-action@v3 |
| 32 | + |
30 | 33 | - name: Set up Docker Buildx |
31 | 34 | uses: docker/setup-buildx-action@v3 |
32 | 35 |
|
@@ -88,24 +91,25 @@ jobs: |
88 | 91 | echo "tags=$TAGS" >> $GITHUB_OUTPUT |
89 | 92 | echo "Computed tags: $TAGS" |
90 | 93 |
|
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 }} |
101 | 104 |
|
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