go-ethereum/.github/workflows/build-push.yml
2025-04-07 14:46:55 +03:00

37 lines
1,012 B
YAML

name: build docker image & push to reg
on:
pull_request:
types: [closed]
branches: [master]
paths: ["**"]
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@v3
- name: Log in to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: prep tags
id: vars
run: |
echo "COMMIT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
echo "IMAGE_NAME=${{ secrets.DOCKERHUB_USERNAME }}/geth-dev" >> $GITHUB_ENV
- name: build image
run: |
docker build -t $IMAGE_NAME:latest -t $IMAGE_NAME:$COMMIT_SHA .
- name: push image
run: |
docker push $IMAGE_NAME:latest
docker push $IMAGE_NAME:$COMMIT_SHA