Skip to content

Commit

Permalink
Build Docker image with Git tag, or latest if on main
Browse files Browse the repository at this point in the history
  • Loading branch information
vegarsti committed Jul 3, 2024
1 parent a947e77 commit 680bd9c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: GitHub Tag Name example
env:
TAG: "${{ github.ref_name == 'main' && 'latest' || github.ref_name }}"
run: |
echo "Tag name: $TAG"
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
Expand All @@ -47,5 +41,6 @@ jobs:
- name: Build and push Docker images
env:
DOCKER_HUB_KEY: ${{ secrets.DOCKER_HUB_KEY }}
TAG: "${{ github.ref_name == 'main' && 'latest' || github.ref_name }}"
run: |
make image-push
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ gen-mocks: bin/moq ./client/jsonrpc/ ./client/duneapi/

image-build:
@echo "# Building Docker images"
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v8 -t duneanalytics/node-indexer:latest -f Dockerfile .
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v8 -t "duneanalytics/node-indexer:${TAG}" -f Dockerfile .

image-push:
@echo "# Pushing Docker images to Docker Hub (after building)"
echo -n "${DOCKER_HUB_KEY}" | docker login --username duneanalytics --password-stdin
docker buildx create --name mybuilder
docker buildx use mybuilder
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v8 -t duneanalytics/node-indexer:latest -f Dockerfile --push .
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v8 -t "duneanalytics/node-indexer:${TAG}" -f Dockerfile --push .

0 comments on commit 680bd9c

Please sign in to comment.