Skip to content

feat(infra): Publish Docker image on release#1183

Closed
Alex-deVis wants to merge 1 commit intocrate-ci:masterfrom
Alex-deVis:feat/publish-docker-image
Closed

feat(infra): Publish Docker image on release#1183
Alex-deVis wants to merge 1 commit intocrate-ci:masterfrom
Alex-deVis:feat/publish-docker-image

Conversation

@Alex-deVis
Copy link
Copy Markdown

@Alex-deVis Alex-deVis commented Dec 15, 2024

The post-release job will trigger the publish-docker-image job which builds and pushes the image to the GitHub Container Registry (ghcr.io). The image is tagged with the semver tag and latest.

Regarding #427 (comment), even a focused image can be helpful for local development and testing. I think it would be beneficial to start publishing the image even if it might change in the future.

I tested these changes on my fork:

Fixes: #427

The post-release job will trigger publish-docker-image job which builds
and pushes the image to the GitHub Container Registry (ghcr.io).
The image is tagged with the semver tag and latest.

Signed-off-by: Alex Apostolescu <alexx.apostolescu@gmail.com>
@epage
Copy link
Copy Markdown
Collaborator

epage commented Dec 16, 2024

At my quick glance, this seems very different than the workflow from #1116. As the person purposing this alternative workflow, could you step through why you made different decisions?

@Alex-deVis
Copy link
Copy Markdown
Author

Hello, @epage, thanks for taking the time to review! My PR only addresses building the docker image on release to be able to run the action locally similarly to how it is run on GH actions pipeline. I have no interest in updating the Dockerfile. Therefore, you could say that the PRs are complementary; in my view, changes on Dockerfile should be separated from changes on actions.

The backbone for my changes is this guide from GitHub. Let's dive into my changes:

  • the trigger is the completion of post-releaes workflow. I think this is cleaner than release: published since creating a release consists only of creating the page, without any other validation. Bundling the completion of post-releases with the creation of the Docker image ensures that you'd only do it when everything is set and done.

  • Extract tag from master step is needed because we use the post-release completion as the trigger. We have to determine the latest tag ourselves since the trigger is not tied to a tag or a PR. git tag --merged ${{ github.ref_name }} checks the latest tag on the master branch since that is where releases will be.

  • Extract metadata (tags, labels) for Docker step adds the previous tag (type=semver,pattern={{version}},value=${{ env.TAG }}) and latest (type=raw,value=latest,enable={{is_default_branch}}) to the list of tags.

@Alex-deVis
Copy link
Copy Markdown
Author

Hi, @epage! Bump on this.

@epage
Copy link
Copy Markdown
Collaborator

epage commented Jan 13, 2025

Please don't bump. I have a queue I'm working through, made worse from the holidays, and this creates extra noise.

@Alex-deVis
Copy link
Copy Markdown
Author

Hi, @epage, I respect that you have a list and requested not to be bumped on updates. The PR remained stable and requires minimal feedback to go forward and add an essential feature.
To refresh your memory:

  • The PR will create a docker image hosted on the GitHub container registry on every release tag
  • The PR follows the official GitHub documentation with minimal changes (see the referenced links and my comments)
  • The PR addresses a single task, that's why is smaller than its counterpart
  • For a more in-depth explanation check the above comment, or feel free to reach out to me for more context

Again, I respect your schedule and am eager to help you with information to merge this.

@epage
Copy link
Copy Markdown
Collaborator

epage commented Feb 27, 2025

That is very rude to re-bump a PR when you've already been told not to bump it.

@nogweii
Copy link
Copy Markdown

nogweii commented Nov 3, 2025

A couple of comments from a scan:

  • Is it necessary to put ghcr.io into an environment variable? I think it'd likely be the only registry that a typos image gets published to, but I may be wrong.
  • This doesn't appear to build a multi-arch image, so users on arm64 platforms would miss out.

andrey-fomin added a commit to andrey-fomin/typos that referenced this pull request Mar 12, 2026
Provide an official Docker Hub distribution for releases so users can pull
typos without building from source or relying on stale third-party images.

Refs: crate-ci#427
Related: crate-ci#1116, crate-ci#1183
andrey-fomin added a commit to andrey-fomin/typos that referenced this pull request Mar 12, 2026
Provide an official Docker Hub distribution for releases so users can pull
typos without building from source or relying on stale third-party images.

Refs: crate-ci#427
Related: crate-ci#1116, crate-ci#1183
@Alex-deVis Alex-deVis closed this Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Not available dockerhub/external repo for dockerfile

3 participants