-
Notifications
You must be signed in to change notification settings - Fork 8
58 lines (51 loc) · 1.74 KB
/
release-reproducible-smart-contract.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
on:
push:
branches:
- ekw/SRE-1010/migrate-release-flow-gha
tags:
- verifiable-sc/*
env:
SERVICE_NAME: 'verifiable-sc'
SOURCE_IMAGE_TAG: 'rust:1.75.0'
jobs:
release-docker:
runs-on: ubuntu-latest
environment: front-end-tools
steps:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Clone repo
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
submodules: recursive
- name: Set image tag if correctly formatted
env:
TAG: ${{ github.ref_name }}
run: |
SERVICE_TAG=${TAG##${{ env.SERVICE_NAME }}/}
IFS='-' read -r ENVIRONMENT TAG_VERSION <<< "$SERVICE_TAG"
echo "FULL_IMAGE_TAG=concordium/${{ env.SERVICE_NAME }}-${TAG_VERSION}" >> $GITHUB_ENV
echo "ENVIRONMENT=$ENVIRONMENT" >> $GITHUB_ENV
- name: Check if image exist
run: |
set +e
docker manifest inspect ${{ env.FULL_IMAGE_TAG }}
EXITCODE=$?
if [ $EXITCODE -eq "0" ]; then
echo "Error: ${{ env.FULL_IMAGE_TAG }} already exist"
exit 1
fi
- name: Build and push docker image
uses: docker/build-push-action@v6
with:
context: ./reproducible
file: ./reproducible/build.Dockerfile
tags: ${{ env.FULL_IMAGE_TAG }}
no-cache: true
push: false
build-args: |
source_image=${{ env.SOURCE_IMAGE_TAG }}