forked from ethereum/go-ethereum
-
Notifications
You must be signed in to change notification settings - Fork 6
73 lines (63 loc) · 2.06 KB
/
docker.yaml
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Build docker image
on:
push:
tags:
- "[a-z0-9]+-v*"
branches:
# Expected to be <network>/{fix,feature}/<name> where <network> is one of {geth,bsc,polygon,etc.}
- "*/fix/*"
- "*/feature/*"
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push-image:
runs-on: ubuntu-20.04
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.21.x
- uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build Binary
run: make geth
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Generate docker tags/labels from github build context
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# We tag latest only release of the form <variant>-v<major>.<minor>.<patch>-fh2.1 so "rc/beta" version are not flagged as latest
# - 2 docker tags: `{geth|bsc|...}-latest` and `{git-tag}`
tags: |
type=ref,event=tag,priority=1000
type=ref,event=branch,priority=1000
type=match,pattern=^(.*)-v\d+.\d+.\d+-fh,group=1,suffix=-latest-fh3
flavor: |
latest=false
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: ./build/bin
file: ./Dockerfile.fh
push: true
tags: ${{ steps.meta.outputs.tags }}
# org.opencontainers.image.version will match the tag name
labels: ${{ steps.meta.outputs.labels }}