Skip to content

Commit

Permalink
fix(build-docker-image-reg): load image and output correct name
Browse files Browse the repository at this point in the history
  • Loading branch information
EdieLemoine committed Jun 15, 2022
1 parent 709abd3 commit cbe0f97
Showing 1 changed file with 9 additions and 20 deletions.
29 changes: 9 additions & 20 deletions build-docker-image-reg/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,30 +36,11 @@ inputs:
outputs:
tagged-image:
description: 'Created image name with tag'
value: ${{ steps.prepare.outputs.tagged-image }}

tags:
description: 'Tags of the created image'
value: ${{ steps.meta.outputs.tags }}

labels:
description: 'Labels of the created image'
value: ${{ steps.meta.outputs.labels }}

runs:
using: composite
steps:
- name: 'Prepare'
id: prepare
run: |
IMAGE=$(echo ${{ inputs.image }})
ARGS=$(echo ${{ inputs.docker-args }} | shasum | head -c 40)
TAG=$(echo $GITHUB_SHA | head -c7)
echo ::set-output name=args::${ARGS}
echo ::set-output name=tag::${TAG}
echo ::set-output name=tagged-image::${IMAGE}:${TAG}
shell: bash

- uses: actions/checkout@v3

- uses: docker/login-action@v2
Expand All @@ -83,9 +64,17 @@ runs:
- uses: docker/build-push-action@v3
with:
context: ${{ inputs.context }}
push: true
load: true
target: ${{ inputs.target }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: ${{ steps.cache.outputs.cache-from }}

- uses: docker/build-push-action@v3
with:
context: ${{ inputs.context }}
push: true
target: ${{ inputs.target }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-to: ${{ steps.cache.outputs.cache-to }}

0 comments on commit cbe0f97

Please sign in to comment.