Skip to content
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

feat: add docker publish workflow #238

Closed
wants to merge 1 commit into from

Conversation

jonathanmorley
Copy link

@jonathanmorley jonathanmorley commented Sep 24, 2024

Pull Request

Proposed Changes

This adds a workflow that will publish the docker images (x86 and arm64) to ECR.

Notes:

  • It assumes the existence of a ubuntu-22.04-medium-arm64 runner, which is non-standard
  • It currently needs to be manually invoked

Readiness Checklist

Author/Contributor

  • If documentation is needed for this change, has that been included in this pull request
  • run npm run lint and fix any linting issues that have been introduced
  • run npm run test and run tests
  • If publishing new data to the public (scorecards, security scan results, code quality results, live dashboards, etc.), please request review from @jeffrey-luszcz

Reviewer

  • Label as either bug, documentation, enhancement, infrastructure, maintenance, or breaking

@jonathanmorley jonathanmorley requested a review from a team as a code owner September 24, 2024 13:51
@jonathanmorley
Copy link
Author

Requesting review from @Jeffrey-Luszcz

Copy link
Contributor

@ahpook ahpook left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this @jonathanmorley ! I had a need for exactly this workflow tonight and started working on it in #240 before I saw that you'd opened this one. We should probably combine forces on them, because I like that you're building a matrix of architectures but would really like to have version-numbered containers. WDYT?

.github/workflows/docker-publish.yml Show resolved Hide resolved
run: |
mkdir -p /tmp/digests
digest="${{ steps.build.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand correctly this will push a container that has to be referenced by the same sha as the commit from which it's built, right?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the arch-specific images get pushed to the registry without an explicit label. The digest you see here is a way to refer to those arch-specific images. It would not be the same as the git commit SHA.

The merge action then picks up on the digests, and references them all when making the arch-independent image

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its very possible that there is a more efficient way of passing information between the jobs than this

@jonathanmorley
Copy link
Author

This does support version numbered containers. See https://github.com/cvent/private-mirrors/actions/runs/11014902329 where I passed in a value of 0.20.0, and it was used as the label of the container, producing https://github.com/cvent/private-mirrors/pkgs/container/private-mirrors/278597478?tag=0.20.0

As mentioned in a comment, ideally this would be attached to the release workflow to auto-publish with the right version number

jmeridth added a commit that referenced this pull request Jan 24, 2025
- [x] start using the ospo-reusable-workflows for auto-labeler, pr-title, release and release-image
- [x] move 'fix' to patch semver, add 'feature' to minor semver, add major/minor/patch labels to semver
- [x] add release-image part to release workflow
  - will generate a release image called privoate-mirrors in ghcr.io with release tag and latest tag
  - might replace #238 (digest work there can be added)

Signed-off-by: jmeridth <[email protected]>
@ahpook
Copy link
Contributor

ahpook commented Jan 24, 2025

Superseded by #302, thanks @jmeridth !

@ahpook ahpook closed this Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants