Skip to content

Commit

Permalink
Merge branch 'master' into fix-transcation-endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
miiu96 authored Aug 5, 2024
2 parents 89ad27b + 1db7ecd commit 3f4af97
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 16 deletions.
45 changes: 29 additions & 16 deletions .github/workflows/deploy-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ name: Build Docker image & push
on:
release:
types: [published]
pull_request:

jobs:
build-docker-image:
Expand All @@ -17,19 +18,31 @@ jobs:

steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}

- name: Build image
run: |
TAG_VERSION=${{ steps.get_version.outputs.VERSION }}
cd ${GITHUB_WORKSPACE} && docker build -t "${REGISTRY_HOSTNAME}/${IMAGE_NODE}:${TAG_VERSION}" -f ./docker/Dockerfile .
- name: Push image
run: |
docker login --username ${{ secrets.DOCKERHUB_USERNAME }} --password ${{ secrets.DOCKERHUB_TOKEN }}
TAG_VERSION=${{ steps.get_version.outputs.VERSION }}
docker push "${REGISTRY_HOSTNAME}/${IMAGE_NODE}:${TAG_VERSION}"
docker logout
uses: actions/checkout@v4

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY_HOSTNAME }}/${{ env.IMAGE_NODE }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log into Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push image to Docker Hub
id: push
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
1 change: 1 addition & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM golang:1.20.7 as builder
LABEL maintainer="multiversx"

WORKDIR /mx-chain-proxy-go
COPY . .
Expand Down

0 comments on commit 3f4af97

Please sign in to comment.