Skip to content

Commit

Permalink
PM-920 update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
piotr-iohk committed Jan 9, 2024
1 parent 0fed9c8 commit 2902aa3
Showing 1 changed file with 35 additions and 9 deletions.
44 changes: 35 additions & 9 deletions .github/workflows/build_stateless_verifier_docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,55 @@ on:
workflow_dispatch:
inputs:
mina_branch:
description: 'Branch of MinaProtocol/mina to checkout'
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: false
type: boolean

env:
MINA_BRANCH: ${{ github.event.inputs.mina_branch }}

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
uses: actions/checkout@v2
- name: 📥 Checkout Mina Repository
uses: actions/checkout@v4
with:
repository: MinaProtocol/mina
ref: ${{ env.MINA_BRANCH }}

- name: Build and Push Docker image
uses: docker/build-push-action@v2
- 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: github.event.inputs.push == true
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- 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 }}
tags: user/delegation-verify:latest
push: false
build-args: |
MINA_BRANCH=${{ env.MINA_BRANCH }}
DUNE_PROFILE=${{ env.DUNE_PROFILE }}
tags: ${{ env.ECR_REPOSITORY_URL }}/${{ env.ECR_REPOSITORY_NAME }}:${{ env.TAG }}
push: ${{ github.event.inputs.push }}

0 comments on commit 2902aa3

Please sign in to comment.