-
Notifications
You must be signed in to change notification settings - Fork 11
101 lines (90 loc) · 3.09 KB
/
publish.yaml
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#
# Copyright SecureKey Technologies Inc. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
name: release
on:
push:
tags:
- 'v*'
jobs:
publish:
name: Publish image
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v2
- name: Setup Go 1.19
uses: actions/setup-go@v2
with:
go-version: 1.19
id: go
- name: Set ENV vars
run: |
TAG=$(git describe --tags --always `git rev-list --tags --max-count=1`)
echo "IMAGE_TAG"=$TAG >> $GITHUB_ENV
echo "IMAGE_PREFIX_VCT"=ghcr.io/trustbloc/vct >> $GITHUB_ENV
echo "IMAGE_PREFIX_LOG_SERVER"=ghcr.io/trustbloc/vct-log-server >> $GITHUB_ENV
echo "IMAGE_PREFIX_LOG_SIGNER"=ghcr.io/trustbloc/vct-log-signer >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Github Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ secrets.CR_USER }}
password: ${{ secrets.CR_PAT }}
- name: Build and Push container images (vct)
uses: docker/build-push-action@v2
with:
context: .
file: ./images/vct/Dockerfile
platforms: linux/amd64,linux/arm64
build-args: |
ALPINE_VER=3.15
GO_VER=1.19
APP_FOLDER=vct
GO_LDFLAGS=-X 'github.com/trustbloc/orb/pkg/httpserver.BuildVersion=${{ env.IMAGE_TAG }}'
push: true
tags: |
${{ env.IMAGE_PREFIX_VCT }}:${{ env.IMAGE_TAG }}
${{ env.IMAGE_PREFIX_VCT }}:latest
- name: Build and Push container images (log-server)
uses: docker/build-push-action@v2
with:
context: .
file: ./images/vct/Dockerfile
platforms: linux/amd64,linux/arm64
build-args: |
ALPINE_VER=3.15
GO_VER=1.19
APP_FOLDER=log_server
push: true
tags: |
${{ env.IMAGE_PREFIX_LOG_SERVER }}:${{ env.IMAGE_TAG }}
${{ env.IMAGE_PREFIX_LOG_SERVER }}:latest
- name: Build and Push container images (log-signer)
uses: docker/build-push-action@v2
with:
context: .
file: ./images/vct/Dockerfile
platforms: linux/amd64,linux/arm64
build-args: |
ALPINE_VER=3.15
GO_VER=1.19
APP_FOLDER=log_signer
push: true
tags: |
${{ env.IMAGE_PREFIX_LOG_SIGNER }}:${{ env.IMAGE_TAG }}
${{ env.IMAGE_PREFIX_LOG_SIGNER }}:latest
- name: Build binaries (vct)
run: make build-vct-dist build-log-server-dist build-log-signer-dist
- name: Upload binaries and their SHA to Github Release
uses: alexellis/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
asset_paths: '["./build/dist/bin/vct*", "./build/dist/bin/log-server*", "./build/dist/bin/log-signer*"]'