forked from OffchainLabs/nitro
-
Notifications
You must be signed in to change notification settings - Fork 9
115 lines (100 loc) · 3.49 KB
/
espresso-docker.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
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# This is a simpler version of the upstream `docker.yml`.
#
# The differences are:
# - Uses GHA docker cache.
# - Does not export the wavm module root as artifact.
name: Espresso Docker build CI
run-name: Docker build CI triggered from @${{ github.actor }} of ${{ github.head_ref }}
on:
workflow_dispatch:
merge_group:
pull_request:
push:
branches:
- master
- develop
- integration
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
docker_build:
strategy:
matrix:
platform: [ linux/amd64, linux/arm64 ]
include:
- platform: linux/amd64
runs-on: X64
- platform: linux/arm64
runs-on: ARM64
runs-on: [ self-hosted, "${{ matrix.runs-on }}" ]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Github Container Repo
uses: docker/login-action@v3
# if: github.event_name != 'pull_request'
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build nitro-node image
uses: ./.github/actions/docker-image
with:
images: ghcr.io/espressosystems/nitro-espresso-integration/nitro-node
target: nitro-node
platforms: ${{ matrix.platform }}
- name: Build nitro-node-dev image
uses: ./.github/actions/docker-image
with:
images: ghcr.io/espressosystems/nitro-espresso-integration/nitro-node-dev
target: nitro-node-dev
platforms: ${{ matrix.platform }}
# Merge the AMD64 and ARM64 images into the final (multiplatform) image.
#
# For documentation refer to
# https://docs.docker.com/build/ci/github-actions/multi-platform/#distribute-build-across-multiple-runners
merge_into_multiplatform_images:
needs:
- docker_build
strategy:
matrix:
target: [ nitro-node, nitro-node-dev ]
include:
- target: nitro-node
image: ghcr.io/espressosystems/nitro-espresso-integration/nitro-node
- target: nitro-node-dev
image: ghcr.io/espressosystems/nitro-espresso-integration/nitro-node-dev
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Github Container Repo
uses: docker/login-action@v2
# if: github.event_name != 'pull_request'
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Download digests
uses: actions/download-artifact@v3
with:
name: "${{ matrix.target }}-digests"
path: "${{ runner.temp }}/digests"
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ matrix.image }}
- name: Create manifest list and push
working-directory: "${{ runner.temp }}/digests"
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf '${{ matrix.image }}@sha256:%s ' *)
- name: Inspect image
run: |
docker buildx imagetools inspect ${{ matrix.image }}:${{ steps.meta.outputs.version }}