Skip to content

feat: Add docker-compose for testing purposes #1

feat: Add docker-compose for testing purposes

feat: Add docker-compose for testing purposes #1

name: Publish Docker image
on:
push:
branches: [main]
workflow_dispatch:
inputs:
image-name:
description: Image name
required: true
default: eigenda-blob-scraper
tag:
description: Image tag
required: true
dockerfile:
description: Dockerfile
required: true
default: Dockerfile
fetch-interval:
description: Fetch interval in seconds, default 1 minute
required: false
default: 60
api-url:
description: Endpoint to get the blob json data from
required: false
default: https://blobs-goerli.eigenda.xyz/api/trpc/blobs.getBlobs
jobs:
publish-docker:
name: Publish to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- 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_ACCESS_TOKEN }}
- name: Build and push image to Docker Hub (staging)
run: |
branch=$(echo "${{ github.ref }}" | sed -e "s/refs\/heads\///g")
original_tag=${{ github.event.inputs.tag || '$branch' }}
tag=$(echo "$original_tag" | sed 's/\//-/g') # replace '/' with '-' in tag na
echo "Building image with tag $tag"
docker buildx build --platform=linux/amd64,linux/arm64 \
-f ${{ github.event.inputs.dockerfile || 'Dockerfile' }} \
-t "nethermind/${{ github.event.inputs.image-name }}:$tag" \
--build-arg BUILD_FETCH_INTERVAL=${{ github.event.inputs.fetch-interval }} \
--build-arg BUILD_API_URL=${{ github.event.inputs.api-url }} \
. --push