-
Notifications
You must be signed in to change notification settings - Fork 63
97 lines (96 loc) · 2.66 KB
/
build-push.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Build docker image
on:
push:
branches:
- master
tags:
- '**'
workflow_dispatch:
inputs:
repository:
default: ethpandaops/ethereum-genesis-generator
type: string
required: true
ref:
description: The branch, tag or SHA to checkout and build from
default: master
type: string
required: true
docker_tag:
description: Override target docker tag (defaults to the above source ref if left blank)
type: string
required: false
jobs:
build-push:
name: build-x64
runs-on: ubuntu-latest
steps:
- name: Checkout this repo
uses: actions/checkout@v3
- name: Set up Docker Context for Buildx
shell: bash
id: buildx-context
run: |
docker context use builders || docker context create builders
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
endpoint: builders
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ethpandaops/ethereum-genesis-generator
flavor: latest=true
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
build-push-arm:
name: build-arm
runs-on: ARM
steps:
- name: Checkout this repo
uses: actions/checkout@v3
- name: Set up Docker Context for Buildx
shell: bash
id: buildx-context
run: |
docker context use builders || docker context create builders
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
endpoint: builders
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ethpandaops/ethereum-genesis-generator
flavor: latest=true
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
push-image:
needs:
- build-x64
- build-arm
name: push-image
runs-on: ubuntu-latest
steps:
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: docker-build-push
id: docker_build
uses: docker/build-push-action@v4
with:
context: .
file: Dockerfile
tags: ${{ steps.meta.outputs.tags }}
push: true
platforms: linux/amd64,linux/arm64
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}