Skip to content

Commit

Permalink
Merge pull request #1 from PavelSBorisov/docker-pipeline
Browse files Browse the repository at this point in the history
[Limechain] Create workflow to build docker image and push to dockerhub
  • Loading branch information
PavelSBorisov authored Aug 26, 2024
2 parents 1d006bd + 160f2c2 commit 8311605
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/docker-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
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

- 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

0 comments on commit 8311605

Please sign in to comment.