lDisclaimer: I have never heard of GitHub Packages before.
According to the example on the GitHub Packages website that shows some Docker CLI commands including docker login
below,
$ docker login docker.pkg.github.com --username phanatic
Logged in successfully
$ docker tag app docker.pkg.github.com/phanatic/repo/app:1.0
$ docker push docker.pkg.github.com/phanatic/repo/app:1.0.0
I think MY_REGISTRY
should be docker.pkg.github.com
and MY_USERNAME
should be your username (phanatic
in the example above). Also your <to><image>
(the target Docker image name) should start with docker.pkg.github.com/<your username >/...
, as above.
The GitHub Packages docs (here and here) seem to suggest that you can use GITHUB_TOKEN
as a password in GitHub Actions. I strongly recommend you encrypt the password value (GITHUB_TOKEN
) for <password>
in settings.xml
. See the Maven doc for how to do so. You will need to create settings-security.xml
.
Before using settings.xml
and settings-security.xml
, I would first locally test the username and GITHUB_TOKEN
combination with <to><auth><username>
and <to><auth><password>
(unencrypted) for the purpose of checking if these values work.