Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 18 additions & 19 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,23 @@ jobs:
with:
install: true

- name: Build and push image with attestations
- name: Build and push image (with attestations)
run: |
set -euo pipefail
IMAGE="${{ secrets.CI_REGISTRY_IMAGE }}"
TAG="${{ inputs.version }}"
docker buildx build \
--push \
--platform linux/amd64 \
--tag ${{ secrets.CI_REGISTRY_IMAGE }}:$TAG \
--sbom=true \
--provenance=true \
--pull \
--no-cache \
.

- name: Tag and push as latest (with attestations)
if: inputs.tag_latest == true
run: |
TAG="${{ inputs.version }}"
# Re-tag using buildx to maintain attestations
docker buildx imagetools create \
--tag ${{ secrets.CI_REGISTRY_IMAGE }}:latest \
${{ secrets.CI_REGISTRY_IMAGE }}:$TAG

ARGS=(
--push
--platform linux/amd64
--tag "${IMAGE}:${TAG}"
--sbom=true
--provenance=true
--pull
)

if [[ "${{ inputs.tag_latest }}" == "true" ]]; then
ARGS+=( --tag "${IMAGE}:latest" )
fi

docker buildx build "${ARGS[@]}" .