From 6bb812e6ae95c1f3dbc4ce355126dea73b3bc261 Mon Sep 17 00:00:00 2001 From: Derek Su Date: Fri, 12 Jul 2024 20:11:45 +0800 Subject: [PATCH] fix(ci): fix wrong tagged build name Signed-off-by: Derek Su --- .github/workflows/build.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a03e0a124..7440b1f73 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -96,6 +96,7 @@ jobs: # longhornio/longhorn-engine image - name: docker-build-longhorn-engine + if: ${{ startsWith(github.ref, 'refs/heads/') }} uses: docker/build-push-action@v5 with: context: . @@ -117,6 +118,17 @@ jobs: sbom: true build-args: | ARCH=amd64 + - name: docker-build-longhorn-engine-with-tag + if: ${{ startsWith(github.ref, 'refs/tags/') }} + uses: docker/build-push-action@v5 + with: + context: . + push: false + platforms: linux/amd64 + tags: longhornio/longhorn-engine:${{ github.ref_name }}-amd64 + file: package/Dockerfile + build-args: | + ARCH=amd64 - name: docker-publish-longhorn-engine-with-tag if: ${{ startsWith(github.ref, 'refs/tags/') }} uses: docker/build-push-action@v5 @@ -175,6 +187,7 @@ jobs: # longhornio/longhorn-engine image - name: docker-build-longhorn-engine + if: ${{ startsWith(github.ref, 'refs/heads/') }} uses: docker/build-push-action@v5 with: context: . @@ -196,6 +209,17 @@ jobs: sbom: true build-args: | ARCH=arm64 + - name: docker-build-longhorn-engine-with-tag + if: ${{ startsWith(github.ref, 'refs/tags/') }} + uses: docker/build-push-action@v5 + with: + context: . + push: false + platforms: linux/arm64 + tags: longhornio/longhorn-engine:${{ github.ref_name }}-arm64 + file: package/Dockerfile + build-args: | + ARCH=arm64 - name: docker-publish-longhorn-engine-with-tag if: ${{ startsWith(github.ref, 'refs/tags/') }} uses: docker/build-push-action@v5