mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 07:06:42 +00:00
Add build workflow
This commit is contained in:
parent
29c37eba79
commit
5508c84690
1 changed files with 37 additions and 0 deletions
37
.github/build-push.yml
vendored
Normal file
37
.github/build-push.yml
vendored
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
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
|
||||||
Loading…
Reference in a new issue