forked from ethereum/go-ethereum
-
Notifications
You must be signed in to change notification settings - Fork 0
28 lines (23 loc) · 975 Bytes
/
docker-pipeline.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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