Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 101 additions & 0 deletions .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Docker Release

on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
tag:
description: 'Image tag (e.g., 1.2.0-rc1)'
required: true
type: string

env:
REGISTRY: docker.io
REPO_NAME: primev

jobs:
build-and-push:
name: Build & Push Images
runs-on: ubuntu-24.04
timeout-minutes: 60

steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0

- name: Generate Tag
id: tag
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
TAG="${{ github.event.inputs.tag }}"
else
# Extract version from tag (v1.2.0 -> 1.2.0)
TAG="${GITHUB_REF#refs/tags/v}"
fi
echo "value=${TAG}" >> $GITHUB_OUTPUT
echo "Generated tag: ${TAG}"

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and Push Images
working-directory: infrastructure/docker
env:
TAG: ${{ steps.tag.outputs.value }}
REGISTRY: ${{ env.REPO_NAME }}
REPO_NAME: ${{ env.REPO_NAME }}
GIT_BRANCH: ${{ github.ref_name }}
GIT_COMMIT: ${{ github.sha }}
PLATFORM: linux/amd64
run: |
docker buildx bake \
mev-commit-oracle \
mev-commit \
mev-commit-bridge \
mev-commit-dashboard \
preconf-rpc \
bidder-emulator \
provider-emulator \
realbidder-emulator \
relay-emulator \
l1-volume-indexer \
snode \
--set "*.output=type=registry" \
--push

echo "✅ Images pushed with tag: ${TAG}"

- name: Summary
run: |
echo "## 🐳 Docker Images Released" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Tag:** \`${{ steps.tag.outputs.value }}\`" >> $GITHUB_STEP_SUMMARY
echo "**Commit:** \`${{ github.sha }}\`" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Images:" >> $GITHUB_STEP_SUMMARY
echo "- \`primev/primev:${{ steps.tag.outputs.value }}-mev-commit\`" >> $GITHUB_STEP_SUMMARY
echo "- \`primev/primev:${{ steps.tag.outputs.value }}-mev-commit-oracle\`" >> $GITHUB_STEP_SUMMARY
echo "- \`primev/primev:${{ steps.tag.outputs.value }}-mev-commit-bridge\`" >> $GITHUB_STEP_SUMMARY
echo "- \`primev/primev:${{ steps.tag.outputs.value }}-mev-commit-dashboard\`" >> $GITHUB_STEP_SUMMARY
echo "- \`primev/primev:${{ steps.tag.outputs.value }}-preconf-rpc\`" >> $GITHUB_STEP_SUMMARY
echo "- \`primev/primev:${{ steps.tag.outputs.value }}-bidder-emulator\`" >> $GITHUB_STEP_SUMMARY
echo "- \`primev/primev:${{ steps.tag.outputs.value }}-provider-emulator\`" >> $GITHUB_STEP_SUMMARY
echo "- \`primev/primev:${{ steps.tag.outputs.value }}-realbidder-emulator\`" >> $GITHUB_STEP_SUMMARY
echo "- \`primev/primev:${{ steps.tag.outputs.value }}-relay-emulator\`" >> $GITHUB_STEP_SUMMARY
echo "- \`primev/primev:${{ steps.tag.outputs.value }}-l1-volume-indexer\`" >> $GITHUB_STEP_SUMMARY
echo "- \`primev/primev:${{ steps.tag.outputs.value }}-snode\`" >> $GITHUB_STEP_SUMMARY
17 changes: 11 additions & 6 deletions infrastructure/docker/docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,17 @@ variable "GIT_COMMIT" {
function "get_labels" {
params = [component]
result = {
"branch" = GIT_BRANCH != null ? GIT_BRANCH : "unknown"
"commit" = GIT_COMMIT != null ? GIT_COMMIT : "unknown"
"component" = component
"build.timestamp"= timestamp()
"build.tag" = TAG
"org.opencontainers.image.title" = component
"org.opencontainers.image.description" = "Primev ${component} - mev-commit infrastructure"
"org.opencontainers.image.vendor" = "Primev"
"org.opencontainers.image.source" = "https://github.com/primev/mev-commit"
"org.opencontainers.image.url" = "https://github.com/primev/mev-commit"
"org.opencontainers.image.revision" = GIT_COMMIT != null ? GIT_COMMIT : "unknown"
"org.opencontainers.image.version" = TAG
"org.opencontainers.image.created" = timestamp()
"org.opencontainers.image.licenses" = "BSL-1.1"
"com.primev.branch" = GIT_BRANCH != null ? GIT_BRANCH : "unknown"
"com.primev.component" = component
}
}

Expand Down Expand Up @@ -175,4 +181,3 @@ target "_common" {
platforms = [PLATFORM]
output = ["type=docker"]
}