update v1.4.20-p1 #17
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
name: Docker Image CI | |
on: | |
push: | |
branches: [ "main" ] | |
tags: [ 'v*.*.*' ] | |
pull_request: | |
branches: [ "main" ] | |
env: | |
IMAGE_NAME: eth2dev/quilibrium | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
- name: Set the value | |
run: | | |
echo "git_tag=$(git describe --abbrev=0 --tags $(git rev-list --tags --max-count=1))" >> "$GITHUB_ENV" | |
- name: Use the value | |
run: | | |
printf '%s\n' "$git_tag" | |
- name: Docker login | |
uses: docker/[email protected] | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- name: Build the Docker image | |
run: | | |
docker build \ | |
-f Dockerfile.source \ | |
--build-arg GIT_COMMIT=$(git log -1 --format=%h) \ | |
--build-arg GIT_REPO=$(git config --get remote.origin.url | sed 's/\.git$//') \ | |
--build-arg GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD) \ | |
--build-arg NODE_VERSION=$git_tag \ | |
-t ${{ env.IMAGE_NAME }}:$git_tag \ | |
--no-cache \ | |
. | |
- name: Docker image push | |
run: docker push ${{ env.IMAGE_NAME }}:$git_tag |