-
Notifications
You must be signed in to change notification settings - Fork 986
ci: add Docker build workflow for automated image publishing #98
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
Merged
akshaydeo
merged 1 commit into
main
from
06-19-feat_github_workflow_added_for_transport_docker_image
Jun 20, 2025
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| name: Build and Push HTTP Transport Docker Image | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - "transports/v*" # Triggers on version tags like transports/v1.0.0, transports/v2.1.0, etc. | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| env: | ||
| REGISTRY: docker.io | ||
| ACCOUNT: maximhq | ||
| IMAGE_NAME: bifrost | ||
|
|
||
| jobs: | ||
| build-and-push: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Extract and validate metadata | ||
| id: meta | ||
| run: | | ||
| # Extract tag name | ||
| TAG=${GITHUB_REF#refs/tags/} | ||
| echo "tag=${TAG}" >> $GITHUB_OUTPUT | ||
|
|
||
| # Extract version from tag | ||
| VERSION=${TAG#transports/v} | ||
|
|
||
| # Validate version format | ||
| if ! echo "$VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+$'; then | ||
| echo "Error: Invalid tag format '$TAG'. Expected format: transports/vMAJOR.MINOR.PATCH" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Create image tags | ||
| echo "tags<<EOF" >> $GITHUB_OUTPUT | ||
| echo "${{ env.REGISTRY }}/${{ env.ACCOUNT }}/${{ env.IMAGE_NAME }}:${TAG}" >> $GITHUB_OUTPUT | ||
| echo "${{ env.REGISTRY }}/${{ env.ACCOUNT }}/${{ env.IMAGE_NAME }}:latest" >> $GITHUB_OUTPUT | ||
| echo "EOF" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Set up QEMU | ||
| uses: docker/setup-qemu-action@v3 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Log in to Docker Hub | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| username: ${{ secrets.DOCKER_USERNAME }} | ||
| password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
Pratham-Mishra04 marked this conversation as resolved.
|
||
|
|
||
| - name: Build and push Docker image | ||
| uses: docker/build-push-action@v5 | ||
| with: | ||
| context: ./transports | ||
| file: ./transports/Dockerfile | ||
| push: true | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| labels: | | ||
| org.opencontainers.image.title=Bifrost LLM Gateway (HTTP) | ||
| org.opencontainers.image.description=The fastest LLM gateway written in Go. Learn more here: https://github.com/maximhq/bifrost | ||
| org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }} | ||
| org.opencontainers.image.version=${{ steps.meta.outputs.tag }} | ||
| org.opencontainers.image.created=${{ github.event.head_commit.timestamp }} | ||
| org.opencontainers.image.revision=${{ github.sha }} | ||
| build-args: | | ||
| TRANSPORT_TYPE=http | ||
| platforms: linux/amd64,linux/arm64 | ||
| cache-from: type=gha | ||
| cache-to: type=gha,mode=max | ||
|
|
||
| - name: Image digest | ||
| run: echo "Image pushed successfully with tags from previous step" | ||
|
Pratham-Mishra04 marked this conversation as resolved.
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.