27
27
tags :
28
28
- ' [0-9]+.[0-9]+.[0-9]+'
29
29
- ' [0-9]+.[0-9]+'
30
+ branches :
31
+ - ' release-**'
30
32
31
33
concurrency :
32
34
group : ${{ github.workflow }}-${{ github.ref }}
@@ -71,12 +73,19 @@ jobs:
71
73
ref_name=${{ github.ref_name }}
72
74
if [ "$ref_name" == "main" ]; then
73
75
ref_name="next"
76
+ elif [[ "$ref_name" =~ ^release-([0-9]+)\.([0-9]+) ]]; then
77
+ # next-1.y
78
+ ref_name="next-${BASH_REMATCH[1]}.${BASH_REMATCH[2]}"
74
79
fi
75
- # from 1.6.1 => 1.6
76
- ref_name_short="${ref_name%.*}"
77
- if [[ $ref_name_short == "1" ]]; then
78
- ref_name_short="${ref_name}"
80
+ ref_name_short="${ref_name}"
81
+
82
+ # for releases only
83
+ if [[ $ref_name != "next" ]] && [[ $ref_name != "next-"* ]]; then
84
+ # shroten from 1.6.1 => 1.6
85
+ ref_name_short="${ref_name%.*}"
86
+ if [[ $ref_name_short == "1" ]]; then ref_name_short="${ref_name}"; fi
79
87
fi
88
+
80
89
echo "REF_NAME=$ref_name" >> $GITHUB_ENV
81
90
echo "REF_NAME_SHORT=${ref_name_short}" >> $GITHUB_ENV
82
91
echo "PLATFORM=$platform" >> $GITHUB_ENV
89
98
- name : Build and Push with Buildx (for :next builds, 14d expiry)
90
99
uses : ./.github/actions/docker-build
91
100
id : build-next
92
- if : ${{ env.REF_NAME_SHORT == 'next' }}
101
+ if : ${{ env.REF_NAME_SHORT == 'next' || env.REF_NAME_SHORT == 'next-'* }}
93
102
with :
94
103
registry : ${{ env.REGISTRY }}
95
104
username : ${{ secrets.QUAY_USERNAME }}
@@ -105,7 +114,7 @@ jobs:
105
114
- name : Build and Push with Buildx (for releases, 183d expiry)
106
115
uses : ./.github/actions/docker-build
107
116
id : build-release
108
- if : ${{ env.REF_NAME_SHORT != 'next' }}
117
+ if : ${{ env.REF_NAME_SHORT != 'next' && env.REF_NAME_SHORT != 'next-'* }}
109
118
with :
110
119
registry : ${{ env.REGISTRY }}
111
120
username : ${{ secrets.QUAY_USERNAME }}
@@ -120,15 +129,15 @@ jobs:
120
129
121
130
- name : Export digest (for :next builds)
122
131
id : export-digest-next
123
- if : ${{ env.REF_NAME_SHORT == 'next' }}
132
+ if : ${{ env.REF_NAME_SHORT == 'next' || env.REF_NAME_SHORT == 'next-'* }}
124
133
run : |
125
134
mkdir -p /tmp/digests
126
135
digest="${{ steps.build-next.outputs.digest }}"
127
136
touch "/tmp/digests/${digest#sha256:}"
128
137
129
138
- name : Export digest (for releases)
130
139
id : export-digest-release
131
- if : ${{ env.REF_NAME_SHORT != 'next' }}
140
+ if : ${{ env.REF_NAME_SHORT != 'next' && env.REF_NAME_SHORT != 'next-'* }}
132
141
run : |
133
142
mkdir -p /tmp/digests
134
143
digest="${{ steps.build-release.outputs.digest }}"
@@ -181,7 +190,7 @@ jobs:
181
190
182
191
- name : Set container metadata (for :next builds, 14d expiry)
183
192
id : meta-next
184
- if : ${{ env.REF_NAME_SHORT == 'next'}}
193
+ if : ${{ env.REF_NAME_SHORT == 'next' || env.REF_NAME_SHORT == 'next-'* }}
185
194
uses : docker/metadata-action@v5
186
195
with :
187
196
images : ${{ env.REGISTRY }}/${{ env.REGISTRY_IMAGE }}
@@ -193,7 +202,7 @@ jobs:
193
202
194
203
- name : Set container metadata (for releases, 183d expiry)
195
204
id : meta-release
196
- if : ${{ env.REF_NAME_SHORT != 'next' }}
205
+ if : ${{ env.REF_NAME_SHORT != 'next' && env.REF_NAME_SHORT != 'next-'* }}
197
206
uses : docker/metadata-action@v5
198
207
with :
199
208
images : ${{ env.REGISTRY }}/${{ env.REGISTRY_IMAGE }}
@@ -220,12 +229,12 @@ jobs:
220
229
221
230
- name : Inspect image (for :next builds)
222
231
id : inspect-next
223
- if : ${{ env.REF_NAME_SHORT == 'next'}}
232
+ if : ${{ env.REF_NAME_SHORT == 'next' || env.REF_NAME_SHORT == 'next-'* }}
224
233
run : |
225
234
docker buildx imagetools inspect ${{ env.REGISTRY }}/${{ env.REGISTRY_IMAGE }}:${{ steps.meta-next.outputs.version }}
226
235
227
236
- name : Inspect image (for releases)
228
237
id : inspect-release
229
- if : ${{ env.REF_NAME_SHORT != 'next'}}
238
+ if : ${{ env.REF_NAME_SHORT != 'next' && env.REF_NAME_SHORT != 'next-'* }}
230
239
run : |
231
240
docker buildx imagetools inspect ${{ env.REGISTRY }}/${{ env.REGISTRY_IMAGE }}:${{ steps.meta-release.outputs.version }}
0 commit comments