Skip to content

docker builds an image action - #20

Merged
r-fedorov merged 1 commit into
mainfrom
tests
Jun 19, 2026
Merged

docker builds an image action#20
r-fedorov merged 1 commit into
mainfrom
tests

Conversation

@r-fedorov

@r-fedorov r-fedorov commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

Summary by Sourcery

CI:

  • Introduce a Docker image GitHub Actions workflow that builds on pushes, PRs, and manual dispatch, runs a smoke test, and pushes images from the main branch to GHCR.

Summary by CodeRabbit

  • Chores
    • Automated container image building and deployment pipeline added with health verification to ensure reliability of containerized releases.

@sourcery-ai

sourcery-ai Bot commented Jun 19, 2026

Copy link
Copy Markdown

Reviewer's Guide

Adds a GitHub Actions workflow that builds, smoke-tests, and conditionally publishes a Docker image to GitHub Container Registry on pushes to main, tests, PRs, and manual dispatches.

Flow diagram for Docker image GitHub Actions workflow

flowchart TD
  trigger((Workflow triggers)) -->|push main| build_and_test
  trigger -->|push tests| build_and_test
  trigger -->|pull_request| build_and_test
  trigger -->|workflow_dispatch| build_and_test

  subgraph build_and_test[Build and smoke test]
    A[actions_checkout] --> B[docker_setup-buildx-action]
    B --> C[docker_build-push-action
Build local image bluenamer:test]
    C --> D[docker run bluenamer-test
and curl /healthz]
  end

  build_and_test --> E{event_name push
and ref refs/heads/main?}
  E -->|yes| F[docker_login-action
Login to ghcr.io]
  F --> G[docker_build-push-action
Push IMAGE_NAME:main and IMAGE_NAME:sha]
  E -->|no| H[[End without publishing]]
Loading

File-Level Changes

Change Details Files
Introduce CI workflow to build, test, and publish Docker images via GitHub Actions.
  • Create a workflow triggered by pushes to main/tests branches, pull requests, and manual workflow_dispatch events.
  • Set repository and package permissions plus an IMAGE_NAME environment variable targeting ghcr.io for the current repository.
  • Configure a docker job on ubuntu-latest that checks out code and enables Docker Buildx.
  • Add conditional login to GitHub Container Registry only for push events on the main branch using the GITHUB_TOKEN.
  • Build a local Docker image for every run and execute a smoke test by running the container and hitting the /healthz endpoint.
  • Conditionally build and push Docker images to GHCR on main pushes with tags for the main branch and the specific commit SHA.
.github/workflows/docker-image.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown

Review Change Stack

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Free

Run ID: 0d6cffb5-cdda-4cb2-86e9-d29d7cbc0d1a

📥 Commits

Reviewing files that changed from the base of the PR and between 6d677b5 and 0194e9c.

📒 Files selected for processing (1)
  • .github/workflows/docker-image.yml

📝 Walkthrough

Walkthrough

A new GitHub Actions workflow .github/workflows/docker-image.yml is added. It triggers on pushes to main/tests, pull requests, and manual dispatch. It builds the Docker image locally, runs a smoke-test container with a /healthz health check, and — only on main pushes — logs into GHCR and publishes the image tagged with main and the commit SHA.

Changes

Docker CI Workflow

Layer / File(s) Summary
Docker build, smoke test, and GHCR publish
.github/workflows/docker-image.yml
Adds the full workflow: conditional GHCR login, local image build for smoke-testing (curl /healthz), container start/stop, and a separate build-and-push step (with main + SHA tags) gated to main branch pushes only.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 A Docker image, fresh and new,
Pushed to ghcr.io in a flash!
A /healthz curl checks it's true,
Then SHA tags mark every dash.
Hop, hop — CI runs with glee,
Containers built for you and me! 🐳


Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

Comment @coderabbitai help to get the list of available commands and usage tips.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 1 issue, and left some high level feedback:

  • The smoke test step relies on a fixed sleep 5 before calling /healthz, which can be flaky under load or slower startups; consider adding a small retry loop with a timeout instead of a single fixed delay.
  • You currently build the Docker image twice on main pushes (once for the smoke test with load: true and again for push: true); you could simplify and speed this up by configuring a single build-push-action step with load: true and conditionally enabling push: true only on main.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The smoke test step relies on a fixed `sleep 5` before calling `/healthz`, which can be flaky under load or slower startups; consider adding a small retry loop with a timeout instead of a single fixed delay.
- You currently build the Docker image twice on `main` pushes (once for the smoke test with `load: true` and again for `push: true`); you could simplify and speed this up by configuring a single `build-push-action` step with `load: true` and conditionally enabling `push: true` only on `main`.

## Individual Comments

### Comment 1
<location path=".github/workflows/docker-image.yml" line_range="21-22" />
<code_context>
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: Check out repository
+        uses: actions/checkout@v6
+
+      - name: Set up Docker Buildx
</code_context>
<issue_to_address>
**issue (bug_risk):** The `actions/checkout` version `v6` does not currently exist and will cause the workflow to fail.

The latest stable major version is `actions/checkout@v4`. Please update this step to use a valid version (e.g. `actions/checkout@v4`) so the workflow runs successfully.
</issue_to_address>

Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +21 to +22
- name: Check out repository
uses: actions/checkout@v6

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

issue (bug_risk): The actions/checkout version v6 does not currently exist and will cause the workflow to fail.

The latest stable major version is actions/checkout@v4. Please update this step to use a valid version (e.g. actions/checkout@v4) so the workflow runs successfully.

@r-fedorov
r-fedorov merged commit fe8dad2 into main Jun 19, 2026
13 checks passed
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.

1 participant