Skip to content

Commit

Permalink
fix: skip latest tag for multiarchitecture manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
maxirmx committed Jan 20, 2025
1 parent 6bd7317 commit 00e2df4
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions .github/workflows/build-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ jobs:
ghcr.io/tamatebako/tebako-${{ matrix.container }}
tags: |
type=semver,pattern={{version}}-${{ matrix.architecture.suffix2 }},value=${{ env.VERSION }},enable=${{ github.event_name == 'workflow_run' }}
type=semver,pattern={{version}}-${{ matrix.architecture.suffix2 }},enable=${{ github.event_name != 'workflow_run' }}
type=semver,pattern={{version}}-${{ matrix.architecture.suffix2 }},enable=${{ contains(github.ref, 'refs/tags/v') }}
type=semver,pattern={{major}}.{{minor}}-${{ matrix.architecture.suffix2 }},value=${{ env.VERSION }},enable=${{ github.event_name == 'workflow_run' }}
type=semver,pattern={{major}}.{{minor}}-${{ matrix.architecture.suffix2 }},enable=${{ github.event_name != 'workflow_run' }}
type=semver,pattern={{major}}.{{minor}}-${{ matrix.architecture.suffix2 }},enable=${{ contains(github.ref, 'refs/tags/v') }}
type=semver,pattern={{major}}-${{ matrix.architecture.suffix2 }},value=${{ env.VERSION }},enable=${{ github.event_name == 'workflow_run' }}
type=semver,pattern={{major}}-${{ matrix.architecture.suffix2 }},enable=${{ github.event_name != 'workflow_run' }}
type=semver,pattern={{major}}-${{ matrix.architecture.suffix2 }},enable=${{ contains(github.ref, 'refs/tags/v') }}
type=sha,suffix=-${{ matrix.architecture.suffix2 }}
labels: |
org.opencontainers.image.vendor=Ribose Inc.
Expand Down Expand Up @@ -128,15 +128,17 @@ jobs:

- name: Create SHA manifest and push
run: |
for tag in $(echo "${{ needs.build-containers.outputs.tags }}" | tr ',' '\n'); do
for tag in $(echo "${{ needs.build-containers.outputs.tags }}" | tr ',' '\n'); do
base_tag=$(echo $tag | sed -E 's/.*:(.*)-(amd64|arm64)/\1/')
echo "Processing $tag, using base tag $base_tag"
docker manifest create \
ghcr.io/tamatebako/tebako-${{ matrix.container }}:$base_tag \
--amend ghcr.io/tamatebako/tebako-${{ matrix.container }}:$base_tag-amd64 \
--amend ghcr.io/tamatebako/tebako-${{ matrix.container }}:$base_tag-arm64
docker manifest push ghcr.io/tamatebako/tebako-${{ matrix.container }}:$base_tag
done
if [ "$base_tag" != "latest" ]; then
echo "Processing $tag, using base tag $base_tag"
docker manifest create \
ghcr.io/tamatebako/tebako-${{ matrix.container }}:$base_tag \
--amend ghcr.io/tamatebako/tebako-${{ matrix.container }}:$base_tag-amd64 \
--amend ghcr.io/tamatebako/tebako-${{ matrix.container }}:$base_tag-arm64
docker manifest push ghcr.io/tamatebako/tebako-${{ matrix.container }}:$base_tag
fi
done
dispatch-dependent-repositories:
name: Dispatch dependent repositories
Expand Down

0 comments on commit 00e2df4

Please sign in to comment.