Skip to content

[Limechain] Modify fetch-depth to ensure history and tags are available in workflow #3

[Limechain] Modify fetch-depth to ensure history and tags are available in workflow

[Limechain] Modify fetch-depth to ensure history and tags are available in workflow #3

name: Build and Push Docker Image
on:
pull_request:
types: [closed]
jobs:
build-and-push-docker-image:
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'CI:Build')
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
- name: Build and push Docker image
run: |
COMMIT=$(git rev-parse --short HEAD)
VERSION=$(git describe --tags --abbrev=0)
BUILDNUM=${{ github.run_number }}
docker build --build-arg COMMIT=$COMMIT --build-arg VERSION=$VERSION --build-arg BUILDNUM=$BUILDNUM -t ${{ secrets.DOCKER_USERNAME }}/go-ethereum-fork:latest .
docker push ${{ secrets.DOCKER_USERNAME }}/go-ethereum-fork:latest