-
Notifications
You must be signed in to change notification settings - Fork 39
52 lines (45 loc) · 1.77 KB
/
build-release-images.yml
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
name: 'Build and Push Release Images'
on:
release:
types: [published]
workflow_dispatch:
inputs:
tag:
description: 'Tag to build and push (leave empty for latest)'
required: true
default: ''
jobs:
build-and-push:
runs-on: ubuntu-latest
environment: production
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.21.8
- name: 'Login to Azure docker registry'
uses: azure/docker-login@v1
with:
login-server: testnetobscuronet.azurecr.io
username: testnetobscuronet
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: 'Get version'
id: get_version
run: |
if [ "${{ github.event_name }}" = "release" ]; then
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
elif [ -n "${{ github.event.inputs.tag }}" ]; then
echo "VERSION=${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT
else
# Fetch the latest tag from the repository
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
echo "VERSION=${LATEST_TAG}" >> $GITHUB_OUTPUT
fi
- name: 'Build and push obscuro node images'
env:
VERSION: ${{ steps.get_version.outputs.VERSION }}
run: |
DOCKER_BUILDKIT=1 docker build -t testnetobscuronet.azurecr.io/obscuronet/enclave:${VERSION} -f dockerfiles/enclave.Dockerfile .
docker push testnetobscuronet.azurecr.io/obscuronet/enclave:${VERSION}
DOCKER_BUILDKIT=1 docker build -t testnetobscuronet.azurecr.io/obscuronet/host:${VERSION} -f dockerfiles/host.Dockerfile .
docker push testnetobscuronet.azurecr.io/obscuronet/host:${VERSION}