Skip to content

dockerize signature aggregator #1

dockerize signature aggregator

dockerize signature aggregator #1

name: Build Docker Images
on:
release:
types: [published]
push:
branches:
- main
pull_request:
branches:
- "**"
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set variables
run: |
source ./scripts/versions.sh
echo GO_VERSION=$GO_VERSION >> $GITHUB_ENV
# set docker tags:
repo=avaplatform/signature-aggregator
if [ "${{ github.event_name }}" == "release" ]; then
docker_tags=${repo}:${{ github.event.release.tag_name }},${repo}:latest
else
# strip slashes from branch name:
branch=$(echo ${{ github.ref_name }} | sed 's/\//-/g')
docker_tags=${repo}:${branch}
fi
echo DOCKER_TAGS=${docker_tags} >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build Docker images
uses: docker/build-push-action@v5
with:
context: .
build-args: |
GO_VERSION=${{ env.GO_VERSION }}
SIGNATURE_AGGREGATOR_API_PORT=8080
SIGNATURE_AGGREGATOR_METRICS_PORT=8081
file: signature-aggregator/Dockerfile
push: true
tags: ${{ env.DOCKER_TAGS }}
secrets: |
github_access_token=${{ secrets.ACTIONS_PAT }}
cache-from: type=gha
cache-to: type=gha,mode=max