-
Notifications
You must be signed in to change notification settings - Fork 12
264 lines (235 loc) · 11.9 KB
/
release_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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
name: Publish Docker Images
on:
release:
types: [published]
workflow_dispatch:
inputs:
iota_node:
type: boolean
description: "Release iota-node image"
required: false
default: false
iota_indexer:
type: boolean
description: "Release iota-indexer image"
required: false
default: false
iota_tools:
type: boolean
description: "Release iota-tools image"
required: false
default: false
iota_graphql_rpc:
type: boolean
description: "Release iota-graphql-rpc image"
required: false
default: false
jobs:
build-iota-node:
if: github.event_name == 'workflow_dispatch' && github.event.inputs.iota_node == 'true' || github.event_name == 'release'
runs-on: self-hosted
environment: release
steps:
- name: Checkout code
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # pin@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # pin@v3
- name: Docker meta for iota-node
id: meta-node
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # pin@v5
with:
images: docker-registry.iota.org/iota-node
# mapping semver tags to networks
# v{MAJOR}.{MINOR}.{PATCH}-alpha -> alphanet
# v{MAJOR}.{MINOR}.{PATCH}-beta -> devnet
# v{MAJOR}.{MINOR}.{PATCH}-rc -> testnet
# v{MAJOR}.{MINOR}.{PATCH} -> mainnet
tags: |
type=raw,value={{sha}},enable=${{ github.event_name == 'workflow_dispatch' }}
type=raw,value=latest,enable=${{ github.event_name == 'workflow_dispatch' }}
type=raw,value={{tag}},enable=${{ github.event_name == 'release' }}
type=raw,value=alphanet,enable=${{ github.event_name == 'release' && contains(github.ref, '-alpha') }}
type=raw,value=devnet,enable=${{ github.event_name == 'release' && contains(github.ref, '-beta') }}
type=raw,value=testnet,enable=${{ github.event_name == 'release' && contains(github.ref, '-rc') }}
type=raw,value=mainnet,enable=${{ github.event_name == 'release' && !contains(github.ref, '-alpha') && !contains(github.ref, '-beta') && !contains(github.ref, '-rc') }}
- name: Login to Docker Registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # pin@v3
with:
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
registry: ${{ secrets.DOCKER_REGISTRY_URL }}
# TODO: Remove when iota-sim is public https://github.com/iotaledger/iota/issues/2149
- name: Set up SSH
uses: MrSquaare/ssh-setup-action@2d028b70b5e397cf8314c6eaea229a6c3e34977a # pin@v3
with:
host: github.com
private-key: ${{ secrets.SSH_PRIVATE_KEY_IOTA_CI }}
private-key-name: github-ppk
- name: Build and push Docker image for iota-node
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # pin@v6
with:
ssh: default
context: .
file: docker/iota-node/Dockerfile
platforms: linux/amd64
tags: ${{ steps.meta-node.outputs.tags }}
push: true
pull: true
build-iota-indexer:
if: github.event_name == 'workflow_dispatch' && github.event.inputs.iota_indexer == 'true' || github.event_name == 'release'
runs-on: self-hosted
environment: release
steps:
- name: Checkout code
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # pin@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # pin@v3
- name: Docker meta for iota-indexer
id: meta-indexer
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # pin@v5
with:
images: docker-registry.iota.org/iota-indexer
# mapping semver tags to networks
# v{MAJOR}.{MINOR}.{PATCH}-alpha -> alphanet
# v{MAJOR}.{MINOR}.{PATCH}-beta -> devnet
# v{MAJOR}.{MINOR}.{PATCH}-rc -> testnet
# v{MAJOR}.{MINOR}.{PATCH} -> mainnet
tags: |
type=raw,value={{sha}},enable=${{ github.event_name == 'workflow_dispatch' }}
type=raw,value=latest,enable=${{ github.event_name == 'workflow_dispatch' }}
type=raw,value={{tag}},enable=${{ github.event_name == 'release' }}
type=raw,value=alphanet,enable=${{ github.event_name == 'release' && contains(github.ref, '-alpha') }}
type=raw,value=devnet,enable=${{ github.event_name == 'release' && contains(github.ref, '-beta') }}
type=raw,value=testnet,enable=${{ github.event_name == 'release' && contains(github.ref, '-rc') }}
type=raw,value=mainnet,enable=${{ github.event_name == 'release' && !contains(github.ref, '-alpha') && !contains(github.ref, '-beta') && !contains(github.ref, '-rc') }}
- name: Login to Docker Registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # pin@v3
with:
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
registry: ${{ secrets.DOCKER_REGISTRY_URL }}
# TODO: Remove when iota-sim is public https://github.com/iotaledger/iota/issues/2149
- name: Set up SSH
uses: MrSquaare/ssh-setup-action@2d028b70b5e397cf8314c6eaea229a6c3e34977a # pin@v3
with:
host: github.com
private-key: ${{ secrets.SSH_PRIVATE_KEY_IOTA_CI }}
private-key-name: github-ppk
- name: Build and push Docker image for iota-indexer
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # pin@v6
with:
ssh: default
context: .
file: docker/iota-indexer/Dockerfile
platforms: linux/amd64
tags: ${{ steps.meta-indexer.outputs.tags }}
push: true
pull: true
build-iota-tools:
if: github.event_name == 'workflow_dispatch' && github.event.inputs.iota_tools == 'true' || github.event_name == 'release'
runs-on: self-hosted
environment: release
steps:
- name: Checkout code
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # pin@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # pin@v3
- name: Docker meta for iota-tools
id: meta-tools
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # pin@v5
with:
images: docker-registry.iota.org/iota-tools
# mapping semver tags to networks
# v{MAJOR}.{MINOR}.{PATCH}-alpha -> alphanet
# v{MAJOR}.{MINOR}.{PATCH}-beta -> devnet
# v{MAJOR}.{MINOR}.{PATCH}-rc -> testnet
# v{MAJOR}.{MINOR}.{PATCH} -> mainnet
tags: |
type=raw,value={{sha}},enable=${{ github.event_name == 'workflow_dispatch' }}
type=raw,value=latest,enable=${{ github.event_name == 'workflow_dispatch' }}
type=raw,value={{tag}},enable=${{ github.event_name == 'release' }}
type=raw,value=alphanet,enable=${{ github.event_name == 'release' && contains(github.ref, '-alpha') }}
type=raw,value=devnet,enable=${{ github.event_name == 'release' && contains(github.ref, '-beta') }}
type=raw,value=testnet,enable=${{ github.event_name == 'release' && contains(github.ref, '-rc') }}
type=raw,value=mainnet,enable=${{ github.event_name == 'release' && !contains(github.ref, '-alpha') && !contains(github.ref, '-beta') && !contains(github.ref, '-rc') }}
- name: Login to Docker Registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # pin@v3
with:
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
registry: ${{ secrets.DOCKER_REGISTRY_URL }}
# TODO: Remove when iota-sim is public https://github.com/iotaledger/iota/issues/2149
- name: Set up SSH
uses: MrSquaare/ssh-setup-action@2d028b70b5e397cf8314c6eaea229a6c3e34977a # pin@v3
with:
host: github.com
private-key: ${{ secrets.SSH_PRIVATE_KEY_IOTA_CI }}
private-key-name: github-ppk
- name: Build and push Docker image for iota-tools
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # pin@v6
with:
ssh: default
context: .
file: docker/iota-tools/Dockerfile
platforms: linux/amd64
tags: ${{ steps.meta-tools.outputs.tags }}
push: true
pull: true
build-iota-graphql-rpc:
if: github.event_name == 'workflow_dispatch' && github.event.inputs.iota_graphql_rpc == 'true' || github.event_name == 'release'
runs-on: self-hosted
environment: release
steps:
- name: Checkout code
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # pin@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # pin@v3
- name: Docker meta for iota-graphql-rpc
id: meta-tools
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # pin@v5
with:
images: docker-registry.iota.org/iota-graphql-rpc
# mapping semver tags to networks
# v{MAJOR}.{MINOR}.{PATCH}-alpha -> alphanet
# v{MAJOR}.{MINOR}.{PATCH}-beta -> devnet
# v{MAJOR}.{MINOR}.{PATCH}-rc -> testnet
# v{MAJOR}.{MINOR}.{PATCH} -> mainnet
tags: |
type=raw,value={{sha}},enable=${{ github.event_name == 'workflow_dispatch' }}
type=raw,value=latest,enable=${{ github.event_name == 'workflow_dispatch' }}
type=raw,value={{tag}},enable=${{ github.event_name == 'release' }}
type=raw,value=alphanet,enable=${{ github.event_name == 'release' && contains(github.ref, '-alpha') }}
type=raw,value=devnet,enable=${{ github.event_name == 'release' && contains(github.ref, '-beta') }}
type=raw,value=testnet,enable=${{ github.event_name == 'release' && contains(github.ref, '-rc') }}
type=raw,value=mainnet,enable=${{ github.event_name == 'release' && !contains(github.ref, '-alpha') && !contains(github.ref, '-beta') && !contains(github.ref, '-rc') }}
- name: Login to Docker Registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # pin@v3
with:
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
registry: ${{ secrets.DOCKER_REGISTRY_URL }}
# TODO: Remove when iota-sim is public https://github.com/iotaledger/iota/issues/2149
- name: Set up SSH
uses: MrSquaare/ssh-setup-action@2d028b70b5e397cf8314c6eaea229a6c3e34977a # pin@v3
with:
host: github.com
private-key: ${{ secrets.SSH_PRIVATE_KEY_IOTA_CI }}
private-key-name: github-ppk
- name: Build and push Docker image for iota-graphql-rpc
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # pin@v6
with:
ssh: default
context: .
file: docker/iota-graphql-rpc/Dockerfile
platforms: linux/amd64
tags: ${{ steps.meta-tools.outputs.tags }}
push: true
pull: true