Skip to content

Commit

Permalink
Publish Docker image to public repository
Browse files Browse the repository at this point in the history
  • Loading branch information
vegarsti authored and msf committed Jun 12, 2024
1 parent 7b88c35 commit 918a5c3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@ jobs:
steps:
- uses: actions/checkout@v3

# - name: Configure AWS Credentials
# uses: aws-actions/configure-aws-credentials@v1.6.1
# with:
# role-to-assume: arn:aws:iam::118330671040:role/duneapi-ci
# aws-region: ${{ env.AWS_REGION }}
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1.6.1
with:
role-to-assume: arn:aws:iam::118330671040:role/node-indexer
aws-region: ${{ env.AWS_REGION }}

# - name: Login to Amazon ECR
# id: login-ecr
# uses: aws-actions/amazon-ecr-login@v1
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- env:
GITHUB_TOKEN: ${{ secrets.DUNE_ENG_ACCESS_TOKEN }}
ECR_REGISTRY: public.ecr.aws/duneanalytics
ECR_REPOSITORY: blockchain-ingester
ECR_REPOSITORY: node-indexer
run: |
make image-build
make image-push
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: all setup lint build test image-build image-push

APPLICATION := ingester
APPLICATION := indexer
GITHUB_SHA ?= HEAD
REF_TAG := $(shell echo ${GITHUB_REF_NAME} | tr -cd '[:alnum:]')
IMAGE_TAG := ${ECR_REGISTRY}/${ECR_REPOSITORY}:${REF_TAG}-$(shell git rev-parse --short "${GITHUB_SHA}")-${GITHUB_RUN_NUMBER}
Expand All @@ -19,7 +19,7 @@ bin/gofumpt: bin
GOBIN=$(PWD)/bin go install mvdan.cc/gofumpt@v0.6.0

build: lint cmd/main.go
go build -o ingester cmd/main.go
go build -o indexer cmd/main.go

lint: bin/golangci-lint bin/gofumpt
go fmt ./...
Expand All @@ -38,11 +38,11 @@ gen-mocks: bin/moq ./client/jsonrpc/ ./client/duneapi/


image-build:
@echo "# Building ingester docker image..."
@echo "# Building indexer docker image..."
docker build -t $(APPLICATION) -f Dockerfile --build-arg GITHUB_TOKEN=${GITHUB_TOKEN} .

image-push: image-build
@echo "# Pushing ingester docker image..."
@echo "# Pushing indexer docker image..."
docker tag $(APPLICATION) ${IMAGE_TAG}
# docker push ${IMAGE_TAG}
docker rmi ${IMAGE_TAG}

0 comments on commit 918a5c3

Please sign in to comment.