I am publishing docker images to GitHub container registry (ghcr.io).
The process of doing that:
- Build component.
- Build docker image which include component.
- Upload docker image to ghcr.io.
- Deploy docker image.
- Run integration tests on docker image.
Sometimes step 4 or 5 return an error which is not resolvable from within the Docker image, and after the issue is fixed, I need to redeploy and retest the artifact.
If this happens, the process of building the component, including junit tests, is a pain because the Docker image is already built and present on ghcr.io.
Is there a way I can see if a tagged Docker image is present in ghcr.io?
URL="https://docker.pkg.github.com/v2/$GITHUB_REPOSITORY/$IMAGE_NAME/manifests/$GITHUB_SHA" REQUEST=$(curl --head --request GET "$URL" -u "$GITHUB_ACTOR:$GITHUB_TOKEN")
– Peart