-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (60 loc) · 2.1 KB
/
build_stateless_verifier_docker.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
name: Build Stateless Verifier Docker Image
on:
workflow_dispatch:
inputs:
mina_branch:
description: 'Branch of MinaProtocol/mina to build from'
required: true
default: 'sventimir/stateless-verification-tool'
dune_profile:
description: 'Dune profile to build with'
required: true
default: 'devnet'
push:
description: 'Push to ECR'
required: true
default: true
type: boolean
env:
MINA_BRANCH: ${{ github.event.inputs.mina_branch }}
DUNE_PROFILE: ${{ github.event.inputs.dune_profile }}
PUSH: ${{ github.event.inputs.push }}
ECR_REPOSITORY_URL: 673156464838.dkr.ecr.us-west-2.amazonaws.com
ECR_REPOSITORY_NAME: delegation-verify
jobs:
build:
runs-on: minafoundation-default-runners
steps:
- name: 📥 Checkout Mina Repository
uses: actions/checkout@v4
with:
repository: MinaProtocol/mina
ref: ${{ env.MINA_BRANCH }}
- name: 🏷️ Generate Tag
run: |
VERSION=$(grep "^version:" ./src/app/delegation_verify/delegation_verify.opam | cut -d '"' -f 2)
MINA_SHA=$(git rev-parse HEAD | cut -c1-7)
TAG="${VERSION}-${MINA_SHA}-${DUNE_PROFILE}"
echo "TAG=${TAG}" >> $GITHUB_ENV
- name: 🔑 ECR Login
if: env.PUSH == 'true'
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: 🔍 Check if Tag already exists
if: env.PUSH == 'true'
id: checktag
uses: tyriis/docker-image-tag-exists@main
with:
registry: ${{ env.ECR_REPOSITORY_URL}}
repository: ${{ env.ECR_REPOSITORY_NAME }}
tag: ${{ env.TAG }}
- name: 🛠️ Build and Push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: dockerfiles/Dockerfile-delegation-stateless-verifier
build-args: |
MINA_BRANCH=${{ env.MINA_BRANCH }}
DUNE_PROFILE=${{ env.DUNE_PROFILE }}
tags: ${{ env.ECR_REPOSITORY_URL }}/${{ env.ECR_REPOSITORY_NAME }}:${{ env.TAG }}
push: ${{ env.PUSH == 'true' && steps.checktag.outputs.tag == 'not found' }}