Skip to content

Commit

Permalink
Merge pull request #9542 from smartcontractkit/chore/release-2.2.0-ch…
Browse files Browse the repository at this point in the history
…erry-pick-ci

Avoid shared tags for root docker images. (#9534)
  • Loading branch information
chainchad authored Jun 12, 2023
2 parents fa76702 + 8d4ac9a commit cc3ee35
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions .github/actions/build-sign-publish-chainlink/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,13 @@ runs:
id: meta-root
uses: docker/metadata-action@c4ee3adeed93b1fa6a762f209fb01608c1a22f1e # v4.4.4
with:
flavor: |
suffix=-root,onlatest=true
# list of Docker images to use as base name for tags
images: ${{ env.shared-images }}
tags: ${{ env.shared-tag-list }}
# XXX: DO NOT USE SHARED TAGS HERE
tags: |
type=ref,event=branch,suffix=${{ inputs.ecr-tag-suffix }}-root
type=semver,pattern={{version}},suffix=${{ inputs.ecr-tag-suffix }}-root
type=sha,format=short,suffix=${{ inputs.ecr-tag-suffix }}-root
- name: Build and push root docker image
id: buildpush-root
Expand All @@ -132,18 +134,13 @@ runs:
CHAINLINK_USER=root
${{ env.shared-build-args }}
- name: Save root image name in GITHUB_ENV and GITHUB_STEP_SUMMARY
- name: Save root image name in GITHUB_ENV
id: save-root-image-name-env
shell: sh
run: |
IMAGES_NAME_RAW=${{ fromJSON(steps.buildpush-root.outputs.metadata)['image.name'] }}
IMAGE_DIGEST=${{ fromJSON(steps.buildpush-root.outputs.metadata)['containerimage.digest'] }}
IMAGE_NAME=$(echo "$IMAGES_NAME_RAW" | cut -d"," -f1)
echo "root_image_name=${IMAGE_NAME}" >> $GITHUB_ENV
echo '## Container Images' >> $GITHUB_STEP_SUMMARY
echo '### Root Image' >> $GITHUB_STEP_SUMMARY
echo "Image Name: ${IMAGE_NAME}" >> $GITHUB_STEP_SUMMARY
echo "Image Digest: ${IMAGE_DIGEST}" >> $GITHUB_STEP_SUMMARY
- name: Generate docker metadata for non-root image
id: meta-nonroot
Expand Down Expand Up @@ -178,7 +175,7 @@ runs:
IMAGE_DIGEST=${{ fromJSON(steps.buildpush-nonroot.outputs.metadata)['containerimage.digest'] }}
IMAGE_NAME=$(echo "$IMAGES_NAME_RAW" | cut -d"," -f1)
echo "nonroot_image_name=${IMAGE_NAME}" >> $GITHUB_ENV
echo '### Non-root Image' >> $GITHUB_STEP_SUMMARY
echo '### Docker Image' >> $GITHUB_STEP_SUMMARY
echo "Image Name: ${IMAGE_NAME}" >> $GITHUB_STEP_SUMMARY
echo "Image Digest: ${IMAGE_DIGEST}" >> $GITHUB_STEP_SUMMARY
Expand Down

0 comments on commit cc3ee35

Please sign in to comment.