Skip to content

Release

Release #4

Workflow file for this run

name: Release
on:
workflow_dispatch:
push:
tags:
- "v*"
jobs:
docker-image:
name: Publish Docker image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get tag version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Print version
run: |
echo $RELEASE_VERSION
echo ${{ env.RELEASE_VERSION }}
- name: Generate Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: |
flashbots/builder-hub
ghcr.io/${{ github.repository }}/builder-hub
labels: org.opencontainers.image.source=${{ github.repositoryUrl }}
tags: |
type=sha
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest,enable=${{ !contains(env.RELEASE_VERSION, '-') }}
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.FLASHBOTS_DOCKERHUB_USERNAME }}
password: ${{ secrets.FLASHBOTS_DOCKERHUB_TOKEN }}
- name: Set up QEMU (for multi-arch builds, optional)
uses: docker/setup-qemu-action@v3
- name: Set up Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push image
uses: docker/build-push-action@v5
with:
context: .
push: true
build-args: |
VERSION=${{ env.RELEASE_VERSION }}
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max