Skip to content

Commit

Permalink
Workflow improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
andyone committed May 27, 2022
1 parent 0bc47a2 commit d6112f1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/docker-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
fi
docker_file="Dockerfile"
base_image=$(grep 'FROM ' $docker_file | tail -1 | cut -f1 -d' ')
base_image=$(grep 'FROM ' $docker_file | tail -1 | cut -f2 -d' ')
if [[ -z "$base_image" ]] ; then
echo "::error::Can't extract base image info"
Expand All @@ -75,23 +75,23 @@ jobs:
echo -e "::group::\033[34mDownloading built image…\033[0m"
if ! docker pull ghcr.io/${{env.IMAGE_NAME}}:latest ; then
echo "::error::Can't download image ${{env.IMAGE_NAME}}:latest"
echo "::error::Can't download image ghcr.io/${{env.IMAGE_NAME}}:latest"
exit 1
fi
echo "::endgroup::"
echo -e "::group::\033[34mDownloading base image…\033[0m"
if ! docker pull ${{steps.metadata.outputs.base_image}} ; then
echo "::error::Can't download image ${{steps.metadata.outputs.base_image}}"
if ! docker pull ${{steps.metadata.outputs.baseimage}} ; then
echo "::error::Can't download image ${{steps.metadata.outputs.baseimage}}"
exit 1
fi
echo "::endgroup::"
base_layer=$(docker inspect "${{steps.metadata.outputs.base_image}}" | jq -r '.[0].RootFS.Layers[-1]')
base_layer=$(docker inspect "${{steps.metadata.outputs.baseimage}}" | jq -r '.[0].RootFS.Layers[-1]')
if [[ -z "$base_image" ]] ; then
if [[ -z "$base_layer" ]] ; then
echo "::error::Can't extract layers info from base image"
exit 1
fi
Expand Down

0 comments on commit d6112f1

Please sign in to comment.