Skip to content

Commit

Permalink
docker-build - more verbose output (#11)
Browse files Browse the repository at this point in the history
* docker-build - more verbose output

* Update action.yml

* Update action.yml

* Update action.yml
  • Loading branch information
macbre authored Sep 16, 2021
1 parent c91145b commit 6af1259
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ runs:
DOCKER_IO_TOKEN: ${{ inputs.docker_io_token }}

run: |
echo "Using $(docker -v)"
echo "::group::Logging into the GitHub Container registry (ghcr.io) ..."
echo "${GITHUB_TOKEN}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
echo "::endgroup::"
Expand All @@ -58,8 +60,8 @@ runs:
# https://docs.docker.com/develop/develop-images/build_enhancements/
# https://docs.docker.com/engine/reference/commandline/build/#specifying-external-cache-sources
docker build . \
--quiet \
>&0 docker build . \
--progress tty \
--cache-from ${{ inputs.repository }}/${{ inputs.image_name }}:latest \
--build-arg BUILDKIT_INLINE_CACHE=1 \
\
Expand Down Expand Up @@ -91,11 +93,7 @@ runs:
echo "::endgroup::"
echo "::group::Pushing the Docker image to ${{ inputs.repository }} ..."
set -x
docker push --quiet ${{ inputs.repository }}/${{ inputs.image_name }}:${COMMIT_TAG}
set +x
>&0 docker push ${{ inputs.repository }}/${{ inputs.image_name }}:${COMMIT_TAG} && echo "Pushed"
echo "::endgroup::"
if [ -z "${DOCKER_IO_TOKEN}" ]; then
Expand All @@ -104,9 +102,7 @@ runs:
echo "::group::Pushing the Docker image to docker.io ..."
echo "${DOCKER_IO_TOKEN}" | docker login docker.io -u "${{ github.actor }}" --password-stdin
set -x
docker push --quiet docker.io/${{ inputs.image_name }}:${COMMIT_TAG}
set +x
>&0 docker push docker.io/${{ inputs.image_name }}:${COMMIT_TAG} && echo "Pushed"
echo "::endgroup::"
fi

0 comments on commit 6af1259

Please sign in to comment.