Skip to content
61 changes: 61 additions & 0 deletions .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
name: Release Fabric-X Committer Docker Image

on:
push:
tags:
- "v*" # Trigger on tags like v0.0.1

permissions:
contents: read
packages: write

jobs:
docker-release:
runs-on: ubuntu-latest

steps:
- name: Checkout source code
uses: actions/checkout@v4

- name: Set up QEMU (for cross-platform builds)
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_HUB_USERNAME }}
Comment thread
anushka159-a marked this conversation as resolved.
Outdated
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract version from tag
id: extract
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
Comment thread
anushka159-a marked this conversation as resolved.
Outdated

Comment thread
anushka159-a marked this conversation as resolved.
- name: Build cross-architecture binaries
run: make build-arch

- name: Build and Push Multi-Platform Docker Image for Committer
uses: docker/build-push-action@v6
Comment thread
anushka159-a marked this conversation as resolved.
with:
context: .
file: ./docker/images/release/Dockerfile
platforms: linux/amd64,linux/arm64,linux/s390x
push: true
build-args: |
BIN=committer
ARCHBIN_PATH=archbin
PORTS=7050
Comment thread
anushka159-a marked this conversation as resolved.
Outdated
tags: |
docker.io/${{ secrets.DOCKER_HUB_USERNAME }}/fabric-x-committer:latest
docker.io/${{ secrets.DOCKER_HUB_USERNAME }}/fabric-x-committer:${{ env.VERSION }}