@@ -22,10 +22,13 @@ jobs:
22
22
# Setting the defaults up front
23
23
LATEST_NODE : 20
24
24
DEFAULT_IMAGE : nodered/node-red
25
+ GH_IMAGE : ghcr.io/node-red/node-red
25
26
DEV_IMAGE : nodered/node-red-dev
27
+ GH_DEV_IMAGE : ghcr.io/node-red/node-red-dev
26
28
runs-on : ubuntu-latest
27
29
28
30
strategy :
31
+ max-parallel : 2
29
32
matrix :
30
33
node : [18, 20, 22]
31
34
suffix : ["", "-minimal"]
@@ -47,16 +50,41 @@ jobs:
47
50
suffix=-${{matrix.node}}${{matrix.suffix}}
48
51
images : |
49
52
${{ env.DEFAULT_IMAGE }}
53
+ ${{ env.GH_IMAGE }}
50
54
tags : |
51
55
type=ref,event=branch
52
56
type=semver,pattern={{version}}
53
57
54
58
-
55
59
name : Setup QEMU
56
60
uses : docker/setup-qemu-action@v3
61
+ with :
62
+ platforms : arm64
63
+ -
64
+ name : Set up SSH key pi5
65
+ uses : MrSquaare/ssh-setup-action@2d028b70b5e397cf8314c6eaea229a6c3e34977a # v3.1.0
66
+ with :
67
+ host : ${{ secrets.SSH_REMOTE_HOST}}
68
+ private-key : ${{ secrets.SSH_PRIVATE_KEY }}
69
+ private-key-name : remote
70
+ port : 2022
71
+ -
72
+ name : Set up SSH key pi4
73
+ uses : MrSquaare/ssh-setup-action@2d028b70b5e397cf8314c6eaea229a6c3e34977a # v3.1.0
74
+ with :
75
+ host : ${{ secrets.SSH_REMOTE_HOST}}
76
+ private-key : ${{ secrets.SSH_PRIVATE_KEY }}
77
+ private-key-name : remote
78
+ port : 2023
57
79
-
58
80
name : Setup Docker buildx
59
81
uses : docker/setup-buildx-action@v3
82
+ with :
83
+ append : |
84
+ - endpoint: ssh://nr@${{ secrets.SSH_REMOTE_HOST }}:2023
85
+ platforms: linux/arm/v6,linux/arm/v7
86
+ - endpoint: ssh://nr@${{ secrets.SSH_REMOTE_HOST }}:2022
87
+ platforms: linux/arm64
60
88
- name : Get Date
61
89
id : date
62
90
# run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H:%M:%SZ')"
83
111
TEMP=${TEMP:1}
84
112
TEMP2=$(echo $GITHUB_REF | awk -F '/' '{ print $3}')
85
113
echo "$GITHUB_REF - $TEMP"
86
- TAGS=$(echo $TAGS | sed "s/$TEMP2/$TEMP/")
114
+ TAGS=$(echo $TAGS | sed "s/$TEMP2/$TEMP/g ")
87
115
TRAVIS_TAG=${{ github.event.inputs.version }}
88
116
else
89
117
TRAVIS_TAG=$(echo $GITHUB_REF | awk -F '/' '{ print $3}')
@@ -93,32 +121,48 @@ jobs:
93
121
94
122
if [[ "$TRAVIS_TAG" =~ ^v[0-9\.-]*$ ]]; then
95
123
IMAGE=${{ env.DEFAULT_IMAGE }}
124
+ GH_IMAGE=${{ env.GH_IMAGE}}
96
125
PUSH=true
97
126
VERSION=${TRAVIS_TAG:1}
98
127
STABLE_VERSION=`echo ${VERSION} | sed -r 's/^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)$/\1.\2/'`
99
128
100
129
if [[ "${{ matrix.node }}" == "${{ env.LATEST_NODE }}" && "${{ matrix.suffix }}" == "" ]]; then
101
- TAGS="$TAGS,$IMAGE:$VERSION,$IMAGE:$STABLE_VERSION,$IMAGE:latest"
130
+ TAGS="$TAGS,$IMAGE:$VERSION,$IMAGE:$STABLE_VERSION,$IMAGE:latest,$GH_IMAGE:$VERSION,$GH_IMAGE:$STABLE_VERSION,$GH_IMAGE:latest "
102
131
elif [[ "${{ matrix.node }}" == "${{ env.LATEST_NODE }}" && "${{ matrix.suffix }}" == "-minimal" ]]; then
103
- TAGS="$TAGS,$IMAGE:$VERSION-minimal,$IMAGE:latest-minimal"
132
+ TAGS="$TAGS,$IMAGE:$VERSION-minimal,$IMAGE:latest-minimal,$GH_IMAGE:$VERSION-minimal,$GH_IMAGE:latest-minimal "
104
133
fi
105
134
106
- TAGS="$TAGS,$IMAGE:latest-${{ matrix.node }}${{ matrix.suffix }}"
135
+ TAGS="$TAGS,$IMAGE:latest-${{ matrix.node }}${{ matrix.suffix }},$GH_IMAGE:latest-${{ matrix.node }}${{ matrix.suffix }} "
107
136
108
137
else
109
138
IMAGE=${{ env.DEV_IMAGE }}
139
+ GH_IMAGE=${{ env.GH_DEV_IMAGE}}
110
140
if [[ "$TRAVIS_TAG" == *"dev"* || "$TRAVIS_TAG" == *"beta"* ]]; then
111
141
PUSH=true
112
142
else
113
143
PUSH=false
114
144
fi
115
145
VERSION=${TRAVIS_TAG}
116
146
TAGS=$(echo $TAGS | sed 's!${{ env.DEFAULT_IMAGE}}!${{ env.DEV_IMAGE }}!')
147
+ TAGS=$(echo $TAGS | sed 's!${{ env.GH_IMAGE}}!${{ env.GH_DEV_IMAGE }}!')
117
148
if [ "${{ matrix.node }}" == "${{ env.LATEST_NODE }}" ] && [ "${{ matrix.suffix}}" == "" ]; then
118
- TAGS="$TAGS,$IMAGE:$VERSION"
149
+ TAGS="$TAGS,$IMAGE:$VERSION,$GH_IMAGE:$VERSION "
119
150
fi
120
151
fi
121
152
153
+ # if [[ "${{ matrix.node }}" == "18"]]; then
154
+ # echo "platforms=linux/amd64,linux/arm/v7,linux/arm64" >> $GITHUB_OUTPUT
155
+ # else
156
+ # echo "platforms=linux/amd64,linux/arm64" >> $GITHUB_OUTPUT
157
+ # fi
158
+
159
+ # if [[ "${{ matrix.suffix }}" == "-minimal" ]]; then
160
+ # echo "platforms=linux/amd64,linux/arm64" >> $GITHUB_OUTPUT
161
+ # else
162
+ # echo "platforms=linux/amd64,linux/arm/v7,linux/arm64" >> $GITHUB_OUTPUT
163
+ # fi
164
+ echo "platforms=linux/amd64,linux/arm/v7,linux/arm64" >> $GITHUB_OUTPUT
165
+
122
166
echo $TAGS
123
167
echo "tags=$TAGS" >> $GITHUB_OUTPUT
124
168
echo "push=$PUSH" >> $GITHUB_OUTPUT
@@ -137,13 +181,20 @@ jobs:
137
181
with :
138
182
username : ${{ secrets.DOCKERHUB_USERNAME }}
139
183
password : ${{ secrets.DOCKERHUB_TOKEN }}
184
+ -
185
+ name : Login to GitHub Container Registry
186
+ uses : docker/login-action@v3
187
+ with :
188
+ registry : ghcr.io
189
+ username : ${{ github.repository_owner }}
190
+ password : ${{ secrets.GITHUB_TOKEN }}
140
191
-
141
192
name : Build and push
142
193
id : build-push
143
194
uses : docker/build-push-action@v5
144
195
with :
145
196
context : .
146
- platforms : linux/amd64, linux/arm64
197
+ platforms : ${{ steps.nrVersion.outputs.platforms }}
147
198
push : ${{ steps.nrVersion.outputs.push }}
148
199
file : .docker/Dockerfile.alpine
149
200
build-args : |
@@ -161,21 +212,31 @@ jobs:
161
212
# Setting the defaults up front
162
213
LATEST_NODE : 20
163
214
DEFAULT_IMAGE : nodered/node-red
215
+ GH_IMAGE : ghcr.io/node-red/node-red
164
216
DEV_IMAGE : nodered/node-red-dev
217
+ GH_DEV_IMAGE : ghcr.io/node-red/node-red-dev
165
218
runs-on : ubuntu-latest
166
219
167
220
steps :
168
221
- name : Checkout
169
222
170
223
- name : Setup QEMU
171
224
uses : docker/setup-qemu-action@v3
225
+ with :
226
+ image : tonistiigi/binfmt:qemu-v7.0.0-28
172
227
- name : Setup Docker buildx
173
228
uses : docker/setup-buildx-action@v3
174
229
- name : Login to DockerHub
175
230
uses : docker/login-action@v3
176
231
with :
177
232
username : ${{ secrets.DOCKERHUB_USERNAME }}
178
233
password : ${{ secrets.DOCKERHUB_TOKEN }}
234
+ - name : Login to GitHub Container Registry
235
+ uses : docker/login-action@v3
236
+ with :
237
+ registry : ghcr.io
238
+ username : ${{ github.repository_owner }}
239
+ password : ${{ secrets.GITHUB_TOKEN }}
179
240
- name : Get Date
180
241
id : date
181
242
# run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H:%M:%SZ')"
@@ -188,6 +249,7 @@ jobs:
188
249
latest=false
189
250
images : |
190
251
${{ env.DEFAULT_IMAGE }}
252
+ ${{ env.GH_IMAGE }}
191
253
tags : |
192
254
type=ref,event=branch
193
255
type=semver,pattern={{version}}
@@ -196,8 +258,15 @@ jobs:
196
258
id : nrVersion
197
259
run : |
198
260
TAGS=""
261
+ while IFS= read -r TAG;do
262
+ if [ -z "$TAGS" ]; then
263
+ TAGS=$TAG
264
+ else
265
+ TAGS="$TAGS,$TAG"
266
+ fi
267
+ done <<< "${{ steps.meta.outputs.tags }}"
199
268
200
- echo Original tags ${{ steps.meta.outputs.tags }}
269
+ echo " Original tags $TAGS"
201
270
202
271
if [[ ! -z "${{ github.event.inputs.version }}" ]]; then
203
272
TRAVIS_TAG=${{ github.event.inputs.version }}
@@ -208,14 +277,16 @@ jobs:
208
277
if [[ "$TRAVIS_TAG" =~ ^v[0-9\.-]*$ ]]; then
209
278
# release build
210
279
IMAGE=${{ env.DEFAULT_IMAGE }}
280
+ GH_IMAGE=${{ env.GH_IMAGE }}
211
281
PUSH=true
212
282
VERSION=${TRAVIS_TAG:1}
213
283
STABLE_VERSION=`echo ${VERSION} | sed -r 's/^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)$/\1.\2/'`
214
284
215
- TAGS="$IMAGE:latest-debian,$IMAGE:$VERSION-debian,$IMAGE:$STABLE_VERSION-debian"
285
+ TAGS="$IMAGE:latest-debian,$IMAGE:$VERSION-debian,$IMAGE:$STABLE_VERSION-debian,$GH_IMAGE:latest-debian,$GH_IMAGE:$VERSION-debian,$GH_IMAGE:$STABLE_VERSION-debian "
216
286
217
287
else
218
288
IMAGE=${{ env.DEV_IMAGE }}
289
+ GH_IMAGE=${{ env.GH_DEV_IMAGE}}
219
290
if [[ "$TRAVIS_TAG" == *"dev"* || "$TRAVIS_TAG" == *"beta"* ]]; then
220
291
# beta build
221
292
PUSH=true
@@ -224,7 +295,7 @@ jobs:
224
295
fi
225
296
VERSION=${TRAVIS_TAG}
226
297
227
- TAGS="$IMAGE:$VERSION-debian"
298
+ TAGS="$IMAGE:$VERSION-debian,$GH_DEV_IMAGE:$VERSION "
228
299
229
300
fi
230
301
0 commit comments