Github Actions worklow fails pushing container image to GHCR using the gradle jib plugin

74 Views Asked by At

Has anybody a working example of how to push a container image into a ghcr using the jib gradle plugin from within a github actions workflow?

I've tried the whole day but whatever combination of password or tokens I try I always end with the jib plugin complaining about an invalid authentication. Although I can push to the ghcr from my local computer with gradlew jib.

Really, I would be very thankful for any help.

> com.google.cloud.tools.jib.plugins.common.BuildStepsExecutionException: Build image failed, perhaps you should make sure you have permissions for ghcr.io/tobias-neubert/eclipse-temurin and set correct credentials. See https://github.com/GoogleContainerTools/jib/blob/master/docs/faq.md#what-should-i-do-when-the-registry-responds-with-forbidden-or-denied for help
1

There are 1 best solutions below

0
On

You have to

  1. allow your repository access to the package (github profile page -> Packages -> Package Settings)
  2. Set the write permission for the GITHUB_TOKEN in your workflow (permissions.packages: write)