Build Docker image & push #99
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
env: | |
IMAGE_NODE: chain-mainnet | |
REGISTRY_HOSTNAME: multiversx | |
name: Build Docker image & push | |
on: | |
release: | |
types: [published] | |
jobs: | |
build-docker-image: | |
strategy: | |
matrix: | |
runs-on: [ubuntu-latest] | |
runs-on: ${{ matrix.runs-on }} | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v2 | |
- 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: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Push image | |
run: | | |
TAG_VERSION=${{ steps.get_version.outputs.VERSION }} | |
docker push "${REGISTRY_HOSTNAME}/${IMAGE_NODE}:${TAG_VERSION}" |