forked from hyperledger/fabric-x-committer
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (50 loc) · 1.6 KB
/
Copy pathdocker-release.yml
File metadata and controls
61 lines (50 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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 }}
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'
- 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
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
tags: |
docker.io/${{ secrets.DOCKER_HUB_USERNAME }}/fabric-x-committer:latest
docker.io/${{ secrets.DOCKER_HUB_USERNAME }}/fabric-x-committer:${{ env.VERSION }}