-
Notifications
You must be signed in to change notification settings - Fork 619
Add github package registry example #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Nick Adcock <nick.adcock@docker.com>
password: ${{ github.token }} | ||
registry: docker.pkg.github.com | ||
repository: myorg/myrepository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be missing a third part, the package name.
Otherwise it'll fail with the following message:
name unknown: docker image push is only supported with a tag of the format :owner/:repo_name/:image_name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still can't get it to work on github registry. Is there any workaround?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, got it to work with hard-coding the full name in the yml.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have to hard-code the image name as well to get past the error.
password: ${{ github.token }} | ||
registry: docker.pkg.github.com | ||
repository: myorg/myrepository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
repository: myorg/myrepository | |
repository: ${{github.repository}}/myrepository |
This should get it working.
Edit: Updated to use the prebuilt Github environment variable for the repository path/name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
github.repository
will only work if the org/project are all characters acceptable for docker (e.g. lowercase. Have to manually input this information if that isn't the case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For sure. I think the error message would output this as well, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fails if your org or repo contains uppercase letters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
repository: myorg/myrepository | |
repository: ${{github.repository}}//my-image |
The last part is the image name: docker.pkg.github.com/my-owner/my-repo/my-image
It is recommend to use the built in environment variable $GITHUB_REPOSITORY |
Try using the suggested syntax. `${{github.repository}}/image_name`
…On Wed, Jun 3, 2020, 01:44 Linda Nichols, ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In README.md
<#14 (comment)>
:
> \ No newline at end of file
+```
+
+### GitHub package registry example
+
+The following pushes the image to the [GitHub package registry](https://help.github.com/en/packages/publishing-and-managing-packages/about-github-packages) using your GitHub username and token as credentials:
+
+```yaml
+uses: ***@***.***
+with:
+ username: ${{ github.actor }}
+ password: ${{ github.token }}
+ registry: docker.pkg.github.com
+ repository: myorg/myrepository
I have to hard-code the image name as well to get past the error.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#14 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABQ4CL6AFEGLWATN34NTSKDRUU3BVANCNFSM4LPHUERA>
.
|
Version 2 has been merged to the main branch and is therefore available via As a reminder, this new version changes drastically and works with 3 new actions (login, setup-buildx and setup-qemu) that we have created. Many usage examples have been added to handle most use cases. This PR seeming obsolete for this new version, I close it. Don't hesitate if you have any questions. |
Add github package registry example