diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 94bc6b9..c3515a2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,7 +40,7 @@ jobs: build-docker-image: name: Build Docker image - runs-on: ubuntu-latest + runs-on: "ubuntu-latest-l-${{matrix.arch}}" strategy: fail-fast: true matrix: @@ -81,10 +81,8 @@ jobs: with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | - type=semver,pattern={{raw}} - type=raw,value=latest-nightly,enable=${{ contains(github.ref, '-nightly') }} - type=semver,pattern=v{{major}}.{{minor}},enable=${{ !contains(github.ref, '-nightly') }} - type=semver,pattern=v{{major}},enable=${{ !contains(github.ref, '-nightly') && !startsWith(github.ref, 'refs/tags/v0.') }} + type=semver,pattern={{raw}},enable=${{ startsWith(github.ref, 'refs/tags/v') }} + type=sha,prefix=,value={{sha}},format=long,enable=${{ !startsWith(github.ref, 'refs/tags/v') }} labels: | maintainer=ConduitIO org.opencontainers.image.title=Conduit-Operator @@ -120,6 +118,7 @@ jobs: run: rm -f .git-credentials merge-push-docker-image: + if: ${{ startsWith(github.ref, 'refs/tags') }} name: Merge and push Docker image runs-on: ubuntu-latest needs: build-docker-image @@ -150,10 +149,8 @@ jobs: with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | - type=semver,pattern={{raw}} - type=raw,value=latest-nightly,enable=${{ contains(github.ref, '-nightly') }} - type=semver,pattern=v{{major}}.{{minor}},enable=${{ !contains(github.ref, '-nightly') }} - type=semver,pattern=v{{major}},enable=${{ !contains(github.ref, '-nightly') && !startsWith(github.ref, 'refs/tags/v0.') }} + type=semver,pattern={{raw}},enable=${{ startsWith(github.ref, 'refs/tags/v') }} + type=sha,prefix=,value={{sha}},format=long,enable=${{ !startsWith(github.ref, 'refs/tags/v') }} labels: | maintainer=ConduitIO org.opencontainers.image.title=Conduit-Operator @@ -171,7 +168,7 @@ jobs: working-directory: /tmp/digests run: | docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ - $(printf '${{ env.IMAGE_NAME }}@sha256:%s ' *) + $(printf '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@sha256:%s ' *) - name: Inspect image run: |