Skip to content

ci: add Docker build workflow for automated image publishing#98

Merged
akshaydeo merged 1 commit intomainfrom
06-19-feat_github_workflow_added_for_transport_docker_image
Jun 20, 2025
Merged

ci: add Docker build workflow for automated image publishing#98
akshaydeo merged 1 commit intomainfrom
06-19-feat_github_workflow_added_for_transport_docker_image

Conversation

@Pratham-Mishra04
Copy link
Copy Markdown
Collaborator

@Pratham-Mishra04 Pratham-Mishra04 commented Jun 19, 2025

Add Docker Image Build and Push Workflow

This PR adds a GitHub Actions workflow that automatically builds and pushes Docker images to Docker Hub when transport-specific tags (transports/v*) are pushed to the repository.

The workflow:

  • Builds the Docker image from the transports/Dockerfile
  • Tags the image with both the specific tag and latest
  • Pushes to Docker Hub under the repository name maximhq/bifrost
  • Includes appropriate OCI metadata labels
  • Configures the build with TRANSPORT_TYPE=http argument
  • Builds for both AMD64 and ARM64 platforms
  • Utilizes GitHub Actions cache for faster builds

Required secrets:

  • DOCKER_USERNAME
  • DOCKER_PASSWORD

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 19, 2025

Warning

Rate limit exceeded

@akshaydeo has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 5 minutes and 41 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 6e8e310 and 231481d.

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

Summary by CodeRabbit

  • Chores
    • Introduced an automated workflow to build and push Docker images for HTTP Transport when version tags are pushed.
      """

Summary by CodeRabbit

  • Chores
    • Added an automated workflow to build and push Docker images for HTTP Transport when new version tags are pushed.

Summary by CodeRabbit

  • Chores
    • Introduced automated workflow to build and push Docker images to Docker Hub when new version tags are pushed.

Walkthrough

A new GitHub Actions workflow file is added to automate building and pushing Docker images to Docker Hub when tags matching specific patterns are pushed. The workflow checks out code, validates semantic version tags, sets up Docker Buildx with QEMU for multi-platform builds, logs into Docker Hub, builds and tags the image with metadata, and pushes it.

Changes

File(s) Change Summary
.github/workflows/docker-build.yml Added a workflow to build and push Docker images on tag pushes, including semantic version validation, multi-platform build, tagging, and OCI labels

Poem

🐇
With a hop and a skip, the Docker builds fly,
Tags on the wind, to the registry they tie.
GitHub now watches for versions anew,
And pushes each image, as rabbits would do!
🐳✨

✨ Finishing Touches
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Post Copyable Unit Tests in Comment
  • Commit Unit Tests in branch 06-19-feat_github_workflow_added_for_transport_docker_image

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Collaborator Author

Pratham-Mishra04 commented Jun 19, 2025

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🔭 Outside diff range comments (1)
.github/workflows/docker-build.yml (1)

65-67: Display the real image digest
Replace the static echo with a reference to the build step’s digest output once you’ve added an id. For example:

- name: Image digest
  run: echo "Image pushed with digest ${{ steps.build.outputs.digest }}"
📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 87dcf80 and 6ae05e7.

📒 Files selected for processing (1)
  • .github/workflows/docker-build.yml (1 hunks)
🔇 Additional comments (4)
.github/workflows/docker-build.yml (4)

1-2: Workflow name is clear and descriptive.
The "Build and Push Docker Image" name accurately conveys the intent of this workflow.


13-18: The job definition (runs-on, permissions) looks appropriate for a Docker Hub push scenario.


36-38: Buildx setup is correct
Using docker/setup-buildx-action@v3 ensures multi-platform support readiness.


39-44: Login step uses secure secrets correctly
docker/login-action@v3 with DOCKERHUB_USERNAME and DOCKERHUB_TOKEN is configured properly.

Comment thread .github/workflows/docker-build.yml Outdated
Comment thread .github/workflows/docker-build.yml
Comment thread .github/workflows/docker-build.yml
Comment thread .github/workflows/docker-build.yml
@Pratham-Mishra04 Pratham-Mishra04 force-pushed the 06-19-feat_github_workflow_added_for_transport_docker_image branch from 6ae05e7 to e9229c4 Compare June 19, 2025 14:10
@Pratham-Mishra04 Pratham-Mishra04 marked this pull request as ready for review June 19, 2025 14:12
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

♻️ Duplicate comments (4)
.github/workflows/docker-build.yml (4)

3-8: Support manual triggering via workflow_dispatch
Consider adding a workflow_dispatch trigger alongside push tags to allow ad-hoc runs of this workflow for testing or emergency rebuilds.
Example diff:

 on:
   push:
     tags:
       - "v*"
       - "transport-*"
+  workflow_dispatch:

9-13: Parameterize registry inputs to avoid hardcoding
Hard-coding ACCOUNT and IMAGE_NAME can lead to maintenance issues if repository metadata changes. Derive these values dynamically, for example:

 env:
   REGISTRY: docker.io
-  ACCOUNT: maximeng
-  IMAGE_NAME: bifrost
+  ACCOUNT: ${{ github.repository_owner }}
+  IMAGE_NAME: ${{ github.event.repository.name }}

28-29: Simplify tag extraction with built-in variable
Use the built-in GITHUB_REF_NAME instead of slicing GITHUB_REF for cleaner metadata extraction:

 run: |
-  TAG=${GITHUB_REF#refs/tags/}
+  TAG=$GITHUB_REF_NAME

49-56: Expose build step outputs for downstream use
Assign an id to the Docker build-and-push step so you can reference its outputs (e.g., image digest) in later steps:

-      - name: Build and push Docker image
+      - name: Build and push Docker image
+        id: build
         uses: docker/build-push-action@v5
         with:
           context: ./transports
📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6ae05e7 and e9229c4.

📒 Files selected for processing (1)
  • .github/workflows/docker-build.yml (1 hunks)
🔇 Additional comments (1)
.github/workflows/docker-build.yml (1)

60-62: Verify chosen timestamp label for image creation
github.event.repository.pushed_at may not be populated for tag events. Confirm this value works as expected, or consider alternatives such as github.event.head_commit.timestamp or generating a timestamp during the build.

Comment thread .github/workflows/docker-build.yml
Comment thread .github/workflows/docker-build.yml
Comment thread .github/workflows/docker-build.yml Outdated
Comment thread .github/workflows/docker-build.yml Outdated
Comment thread .github/workflows/docker-build.yml Outdated
@Pratham-Mishra04 Pratham-Mishra04 force-pushed the 06-19-feat_github_workflow_added_for_transport_docker_image branch from e9229c4 to 1bbbada Compare June 19, 2025 16:27
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

♻️ Duplicate comments (3)
.github/workflows/docker-build.yml (3)

27-28: Use built-in GitHub Actions variable for tag name
Instead of TAG=${GITHUB_REF#refs/tags/}, leverage the native $GITHUB_REF_NAME for clarity and conciseness.


48-54: Add an id to the build-and-push step to capture image digest
Without an id, you can’t expose the digest output. Introduce, for example, id: build, so later steps can reference ${{ steps.build.outputs.digest }}.


68-69: Echo the actual image digest instead of a static message
After assigning an id to the build step, update this step to display:

- name: Image digest
  run: echo "Image digest: ${{ steps.build.outputs.digest }}"
📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e9229c4 and 1bbbada.

⛔ Files ignored due to path filters (1)
  • transports/go.sum is excluded by !**/*.sum
📒 Files selected for processing (1)
  • .github/workflows/docker-build.yml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
🔇 Additional comments (1)
.github/workflows/docker-build.yml (1)

1-2: LGTM: Workflow name is clear and descriptive.

Comment thread .github/workflows/docker-build.yml
Comment thread .github/workflows/docker-build.yml
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (5)
.github/workflows/docker-build.yml (5)

68-70: Display the actual image digest
Instead of a static success message, echo the real digest captured from the build step’s outputs.

-      - name: Image digest
-        run: echo "Image pushed successfully with tags from previous step"
+      - name: Image digest
+        run: echo "Image digest: ${{ steps.build.outputs.digest }}"

3-7: Add manual trigger for ad-hoc runs
Consider adding a workflow_dispatch block to allow on-demand workflow executions for testing or emergency rebuilds.

 on:
   push:
     tags:
       - "transports/v*"
+  workflow_dispatch: {}

9-12: Derive registry parameters dynamically
Hard-coding ACCOUNT and IMAGE_NAME demands manual updates when the repo changes. You can source them from the GitHub context instead.

 env:
   REGISTRY: docker.io
-  ACCOUNT: maximhq
-  IMAGE_NAME: bifrost
+  ACCOUNT: ${{ github.repository_owner }}
+  IMAGE_NAME: ${{ github.event.repository.name }}

27-28: Simplify tag extraction using built-in variable
Replace the manual substring operation with the built-in $GITHUB_REF_NAME for clarity and brevity.

-          TAG=${GITHUB_REF#refs/tags/}
+          TAG=$GITHUB_REF_NAME

48-54: Capture and expose the image digest
Add an id to the build-and-push step, enabling you to reference its digest output in later steps.

       - name: Build and push Docker image
+        id: build
         uses: docker/build-push-action@v5
         with:
📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1bbbada and 60e8342.

⛔ Files ignored due to path filters (1)
  • transports/go.sum is excluded by !**/*.sum
📒 Files selected for processing (1)
  • .github/workflows/docker-build.yml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
🔇 Additional comments (1)
.github/workflows/docker-build.yml (1)

42-47: Ensure required secrets are configured
Make sure DOCKER_USERNAME and DOCKER_PASSWORD exist under the repository’s Actions secrets so the login step can succeed.

#!/bin/bash
# Verify that GitHub Actions secrets for Docker Hub authentication are present
gh api /repos/${{ github.repository }}/actions/secrets \
  | jq -r '.secrets[].name' \
  | grep -E 'DOCKER_USERNAME|DOCKER_PASSWORD'

Comment thread .github/workflows/docker-build.yml
@Pratham-Mishra04 Pratham-Mishra04 force-pushed the 06-19-feat_github_workflow_added_for_transport_docker_image branch 2 times, most recently from e5c42a1 to ff244a2 Compare June 19, 2025 16:58
@Pratham-Mishra04 Pratham-Mishra04 force-pushed the 06-19-feat_github_workflow_added_for_transport_docker_image branch from ff244a2 to 31a087d Compare June 19, 2025 17:10
@akshaydeo akshaydeo force-pushed the 06-19-enhancement_optimised_transports_docker_build branch from 87dcf80 to 552aca5 Compare June 20, 2025 16:04
@akshaydeo akshaydeo force-pushed the 06-19-feat_github_workflow_added_for_transport_docker_image branch from 31a087d to 6e8e310 Compare June 20, 2025 16:04
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@akshaydeo akshaydeo force-pushed the 06-19-feat_github_workflow_added_for_transport_docker_image branch from 6e8e310 to ef32179 Compare June 20, 2025 16:21
@akshaydeo akshaydeo force-pushed the 06-19-enhancement_optimised_transports_docker_build branch from 552aca5 to 22917e2 Compare June 20, 2025 16:21
Copy link
Copy Markdown
Contributor

akshaydeo commented Jun 20, 2025

Merge activity

  • Jun 20, 4:22 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jun 20, 4:23 PM UTC: Graphite rebased this pull request as part of a merge.
  • Jun 20, 4:25 PM UTC: @akshaydeo merged this pull request with Graphite.

@akshaydeo akshaydeo changed the base branch from 06-19-enhancement_optimised_transports_docker_build to graphite-base/98 June 20, 2025 16:22
@akshaydeo akshaydeo changed the base branch from graphite-base/98 to main June 20, 2025 16:22
@akshaydeo akshaydeo force-pushed the 06-19-feat_github_workflow_added_for_transport_docker_image branch from ef32179 to 231481d Compare June 20, 2025 16:23
@akshaydeo akshaydeo merged commit 1aaea33 into main Jun 20, 2025
1 check passed
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Bug: Docker Tagging Error: Avoid Forward Slashes

The Docker image tag is incorrectly generated using the TAG variable (e.g., transports/v1.0.0). Docker tags should not contain forward slashes, as this can cause push failures or lead to misinterpretation of the repository name. The tag should instead use the VERSION variable (e.g., 1.0.0).

.github/workflows/docker-build.yml#L44-L45

echo "tags<<EOF" >> $GITHUB_OUTPUT
echo "${{ env.REGISTRY }}/${{ env.ACCOUNT }}/${{ env.IMAGE_NAME }}:${TAG}" >> $GITHUB_OUTPUT

Fix in Cursor


Was this report helpful? Give feedback by reacting with 👍 or 👎

@akshaydeo akshaydeo deleted the 06-19-feat_github_workflow_added_for_transport_docker_image branch August 31, 2025 17:28
akshaydeo added a commit that referenced this pull request Nov 17, 2025
# Add Docker Image Build and Push Workflow

This PR adds a GitHub Actions workflow that automatically builds and pushes Docker images to Docker Hub when transport-specific tags (`transports/v*`) are pushed to the repository.

The workflow:
- Builds the Docker image from the `transports/Dockerfile`
- Tags the image with both the specific tag and `latest`
- Pushes to Docker Hub under the repository name `maximhq/bifrost`
- Includes appropriate OCI metadata labels
- Configures the build with `TRANSPORT_TYPE=http` argument
- Builds for both AMD64 and ARM64 platforms
- Utilizes GitHub Actions cache for faster builds

Required secrets:
- `DOCKER_USERNAME`
- `DOCKER_PASSWORD`
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.

2 participants