-
Notifications
You must be signed in to change notification settings - Fork 17
Publish Docker images on every main commit #51
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
- Build and push 'latest' tag on every commit to main - Build and push versioned tag only when version changes - Split Docker builds into two separate jobs for clarity - This ensures Docker Hub always has the latest image available
WalkthroughThe workflow configuration for publishing has been refactored to extract and expose the current version from Changes
Poem
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (5)
.github/workflows/publish.yml (5)
13-24
: Improve version extraction robustness.
Usinggrep | cut
onpyproject.toml
is brittle if the formatting changes. Consider using a TOML parser (e.g.,toml-cli
or a small Python snippet) to reliably extract the version string.
28-32
: Document dependency on commit history.
The version change check relies ongit diff HEAD^ HEAD
, which works due tofetch-depth: 2
. Consider adding a comment or assertion to ensure the previous commit is always available to avoid silent failures.
66-93
: DRY Docker setup steps.
The QEMU, Buildx, and Docker login steps are duplicated across two jobs. You could factor these into a reusable composite action or YAML anchor to simplify maintenance and reduce duplication.
84-93
: Assess Docker Hub rate limits.
Sincebuild-and-publish-docker-latest
runs on every commit, you may hit Docker Hub rate limits. Consider adding a concurrency group or rate limiting mechanism to prevent excessive pushes.
18-18
: Remove trailing whitespace.
Several blank lines contain unnecessary spaces, which can trigger YAML lint errors. Please remove trailing whitespace on these lines.Also applies to: 24-24, 98-98, 101-101, 104-104, 107-107, 113-113
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/publish.yml
(3 hunks)README.md
(1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/publish.yml
15-15: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
100-100: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
🪛 YAMLlint (1.37.1)
.github/workflows/publish.yml
[error] 18-18: trailing spaces
(trailing-spaces)
[error] 24-24: trailing spaces
(trailing-spaces)
[error] 98-98: trailing spaces
(trailing-spaces)
[error] 101-101: trailing spaces
(trailing-spaces)
[error] 104-104: trailing spaces
(trailing-spaces)
[error] 107-107: trailing spaces
(trailing-spaces)
[error] 113-113: trailing spaces
(trailing-spaces)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: test
🔇 Additional comments (2)
.github/workflows/publish.yml (1)
94-122
: Validate versioned tag formatting.
Thetags: ...:${{ needs.check-version.outputs.current_version }}
step must receive a clean version string. Ensure there are no newline or whitespace artifacts incurrent_version
by trimming or validating the output.README.md (1)
144-144
: Removed “(Recommended)” from Docker Hub section.
This neutral tone aligns with the new workflow, which now provides bothlatest
and versioned tags without bias.
Summary
This PR updates the Docker publishing workflow to ensure Docker images are always available on Docker Hub by:
latest
tag on every commit to main0.5.0
) only when the version changesProblem
Currently, no Docker images exist on Docker Hub because the workflow only runs when the version changes. This means users can't use the Docker image until a new release is made.
Solution
Split the Docker publishing into two separate jobs:
build-and-publish-docker-latest
- Runs on EVERY main commit, always updates thelatest
tagbuild-and-publish-docker-versioned
- Runs ONLY when version changes, creates version-specific tagsChanges Made
.github/workflows/publish.yml
to have separate Docker build jobsgetmeili/meilisearch-mcp:latest
on main commitsgetmeili/meilisearch-mcp:X.Y.Z
only on version changesResult
After this PR is merged:
latest
Docker imagedocker pull getmeili/meilisearch-mcp:latest
Note
The Docker Hub credentials (
DOCKERHUB_USERNAME
andDOCKERHUB_TOKEN
) need to be configured in the repository secrets for thegetmeili
organization.Summary by CodeRabbit