From 9a783a3f9c6857bb1ee75d3c55154a6b8d7b8a1f Mon Sep 17 00:00:00 2001 From: Vegard Stikbakke Date: Wed, 19 Jun 2024 10:33:53 +0200 Subject: [PATCH] Publish Docker images to ECR --- .github/workflows/build.yaml | 10 ++++++---- Makefile | 19 ++++++++++--------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index d2b804f..341d5a4 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,10 +1,12 @@ --- name: "Build" -on: - push: - branches: - - main +# on: +# push: +# branches: +# - main + +on: pull_request jobs: build: diff --git a/Makefile b/Makefile index f418f5a..cf4f4c0 100644 --- a/Makefile +++ b/Makefile @@ -38,15 +38,16 @@ gen-mocks: bin/moq ./client/jsonrpc/ ./client/duneapi/ image-build: @echo "# Building indexer docker image for amd64 and arm64" - docker buildx build --platform linux/amd64 -t ${IMAGE_TAG}-amd64 -f Dockerfile --build-arg GITHUB_TOKEN=${GITHUB_TOKEN} . - docker buildx build --platform linux/arm64 -t ${IMAGE_TAG}-arm64 -f Dockerfile --build-arg GITHUB_TOKEN=${GITHUB_TOKEN} . + docker buildx build --platform linux/amd64 -t public.ecr.aws/duneanalytics/node-indexer:latest-amd64 -f Dockerfile --build-arg GITHUB_TOKEN=${GITHUB_TOKEN} . + # docker buildx build --platform linux/arm64 -t public.ecr.aws/duneanalytics/node-indexer:latest-arm64 -f Dockerfile --build-arg GITHUB_TOKEN=${GITHUB_TOKEN} . image-push: image-build @echo "# Pushing indexer docker images" - # docker manifest create --insecure "${IMAGE_TAG}" "${IMAGE_TAG}-amd64" - # docker manifest create -a "${IMAGE_TAG}" "${IMAGE_TAG}-arm64" --insecure - # docker manifest push "${IMAGE_TAG}" --insecure - # docker push "${IMAGE_TAG}-amd64" - # docker push "${IMAGE_TAG}-arm64" - # docker rmi "${IMAGE_TAG}-amd64" - # docker rmi "${IMAGE_TAG}-arm64" + # docker manifest create --insecure "latest" "latest-amd64" + # docker manifest create -a "latest" "latest-arm64" --insecure + # docker manifest push "latest" --insecure + aws ecr get-login-password | docker login --username AWS --password-stdin public.ecr.aws/duneanalytics/node-indexer + docker push public.ecr.aws/duneanalytics/node-indexer:latest-amd64 + # docker push "latest-arm64" + # docker rmi "latest-amd64" + # docker rmi "latest-arm64"