Create build-and-push.yml

This commit is contained in:
ilangelov 2025-02-23 14:02:36 +02:00 committed by GitHub
parent 92f5e5cc69
commit 63decbaecc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

31
.github/workflows/build-and-push.yml vendored Normal file
View file

@ -0,0 +1,31 @@
name: Build and Push go-ethereum Image
on:
pull_request:
types:
- closed
branches:
- main
jobs:
build-and-push:
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'CI:Build')
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker image
run: |
docker build -t ${{ secrets.DOCKER_USERNAME }}/go-ethereum:latest .
docker push ${{ secrets.DOCKER_USERNAME }}/go-ethereum:latest