31
31
with :
32
32
checkout_ref : parent-image-updates
33
33
repository : " ${{ github.repository_owner }}/refinery-submodule-parent-images"
34
+ edit_dockerfile : true
34
35
35
36
pi-build :
36
37
name : ' Parent Images: Docker Build'
39
40
environment : dev
40
41
env :
41
42
PYTHON_VERSION : ${{ vars.PYTHON_VERSION }}
42
- DOCKERHUB_CONTAINER_REGISTRY : ${{ vars.DOCKERHUB_CONTAINER_REGISTRY }}
43
- DOCKERHUB_LOGIN_USERNAME : ${{ secrets.DOCKERHUB_LOGIN_USERNAME }}
44
- DOCKERHUB_LOGIN_PASSWORD : ${{ secrets.DOCKERHUB_LOGIN_PASSWORD }}
43
+ DEV_CONTAINER_REGISTRY : ${{ vars.DEV_CONTAINER_REGISTRY }}
44
+ DEV_LOGIN_USERNAME : ${{ secrets.DEV_LOGIN_USERNAME }}
45
+ DEV_LOGIN_PASSWORD : ${{ secrets.DEV_LOGIN_PASSWORD }}
45
46
PARENT_IMAGE_NAME : ${{ vars.PARENT_IMAGE_NAME }}
46
47
DOCKERFILE : ${{ vars.DOCKERFILE }}
47
48
HEAD_REF : parent-image-updates
@@ -83,22 +84,22 @@ jobs:
83
84
with :
84
85
platforms : arm64,arm
85
86
86
- - name : Log into DockerHub registry
87
+ - name : Log into DEV registry
87
88
uses : docker/login-action@v3
88
89
with :
89
- # registry: "${{ env.DOCKERHUB_CONTAINER_REGISTRY }}"
90
- username : " ${{ env.DOCKERHUB_LOGIN_USERNAME }}"
91
- password : " ${{ env.DOCKERHUB_LOGIN_PASSWORD }}"
90
+ registry : " ${{ env.DEV_CONTAINER_REGISTRY }}"
91
+ username : " ${{ env.DEV_LOGIN_USERNAME }}"
92
+ password : " ${{ env.DEV_LOGIN_PASSWORD }}"
92
93
93
94
- name : Build & Push ${{ env.PARENT_IMAGE_NAME }}:${{ env.HEAD_REF }}-${{ matrix.parent_image_type }}
94
95
uses : docker/build-push-action@v5
95
96
with :
96
97
context : .
97
- cache-from : type=registry,ref=${{ env.DOCKERHUB_CONTAINER_REGISTRY }}/${{ env.PARENT_IMAGE_NAME }}:${{ env.HEAD_REF }} -${{ matrix.parent_image_type }}-cache
98
- cache-to : type=registry,ref=${{ env.DOCKERHUB_CONTAINER_REGISTRY }}/${{ env.PARENT_IMAGE_NAME }}:${{ env.HEAD_REF }} -${{ matrix.parent_image_type }}-cache,mode=max,image-manifest=true
98
+ cache-from : type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/${{ env.PARENT_IMAGE_NAME }}:dev -${{ matrix.parent_image_type }}-cache
99
+ cache-to : type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/${{ env.PARENT_IMAGE_NAME }}:dev -${{ matrix.parent_image_type }}-cache,mode=max,image-manifest=true
99
100
platforms : linux/amd64
100
101
file : ${{ env.DOCKERFILE }}
101
- tags : ${{ env.DOCKERHUB_CONTAINER_REGISTRY }}/${{ env.PARENT_IMAGE_NAME }}:${{ env.HEAD_REF }}-${{ matrix.parent_image_type }}
102
+ tags : ${{ env.DEV_CONTAINER_REGISTRY }}/${{ env.PARENT_IMAGE_NAME }}:${{ env.HEAD_REF }}-${{ matrix.parent_image_type }}
102
103
push : true
103
104
build-args : |
104
105
platform=linux/amd64
@@ -108,11 +109,11 @@ jobs:
108
109
uses : docker/build-push-action@v5
109
110
with :
110
111
context : .
111
- cache-from : type=registry,ref=${{ env.DOCKERHUB_CONTAINER_REGISTRY }}/${{ env.PARENT_IMAGE_NAME }}:${{ env.HEAD_REF }} -${{ matrix.parent_image_type }}-arm64-cache
112
- cache-to : type=registry,ref=${{ env.DOCKERHUB_CONTAINER_REGISTRY }}/${{ env.PARENT_IMAGE_NAME }}:${{ env.HEAD_REF }} -${{ matrix.parent_image_type }}-arm64-cache,mode=max,image-manifest=true
112
+ cache-from : type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/${{ env.PARENT_IMAGE_NAME }}:dev -${{ matrix.parent_image_type }}-arm64-cache
113
+ cache-to : type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/${{ env.PARENT_IMAGE_NAME }}:dev -${{ matrix.parent_image_type }}-arm64-cache,mode=max,image-manifest=true
113
114
platforms : linux/arm64
114
115
file : ${{ env.DOCKERFILE }}
115
- tags : ${{ env.DOCKERHUB_CONTAINER_REGISTRY }}/${{ env.PARENT_IMAGE_NAME }}:${{ env.HEAD_REF }}-${{ matrix.parent_image_type }}-arm64
116
+ tags : ${{ env.DEV_CONTAINER_REGISTRY }}/${{ env.PARENT_IMAGE_NAME }}:${{ env.HEAD_REF }}-${{ matrix.parent_image_type }}-arm64
116
117
push : true
117
118
build-args : |
118
119
platform=linux/arm64
@@ -127,6 +128,7 @@ jobs:
127
128
env :
128
129
PYTHON_VERSION : ${{ vars.PYTHON_VERSION }}
129
130
DOCKERHUB_CONTAINER_REGISTRY : ${{ vars.DOCKERHUB_CONTAINER_REGISTRY }}
131
+ DEV_CONTAINER_REGISTRY : ${{ vars.DEV_CONTAINER_REGISTRY }}
130
132
PARENT_IMAGE_NAME : ${{ vars.PARENT_IMAGE_NAME }}
131
133
DOCKERFILE : ${{ vars.DOCKERFILE }}
132
134
HEAD_REF : parent-image-updates
@@ -180,13 +182,15 @@ jobs:
180
182
-i "${{ env.PARENT_IMAGE_NAME }}" \
181
183
-l "${{ env.HEAD_REF }}" \
182
184
-r "${{ env.DOCKERHUB_CONTAINER_REGISTRY }}" \
185
+ -e "${{ env.DEV_CONTAINER_REGISTRY }}" \
183
186
-d "${{ env.DOCKERFILE }}"
184
187
185
188
if [ -f "dev.${{ env.DOCKERFILE }}" ]; then
186
189
bash ${{ github.workspace }}/cicd-deployment-scripts/pi/edit_dockerfile.sh \
187
190
-i "${{ env.PARENT_IMAGE_NAME }}" \
188
191
-l "${{ env.HEAD_REF }}" \
189
192
-r "${{ env.DOCKERHUB_CONTAINER_REGISTRY }}" \
193
+ -e "${{ env.DEV_CONTAINER_REGISTRY }}" \
190
194
-d "dev.${{ env.DOCKERFILE }}"
191
195
fi
192
196
@@ -195,14 +199,14 @@ jobs:
195
199
-i "${{ env.PARENT_IMAGE_NAME }}" \
196
200
-l "${{ env.HEAD_REF }}" \
197
201
-r "${{ env.DOCKERHUB_CONTAINER_REGISTRY }}" \
202
+ -e "${{ env.DEV_CONTAINER_REGISTRY }}" \
198
203
-d "gpu.${{ env.DOCKERFILE }}"
199
204
fi
200
205
201
206
git add requirements/*.txt ${{ env.DOCKERFILE }}
202
207
git add dev.${{ env.DOCKERFILE }} || true
203
208
git add gpu.${{ env.DOCKERFILE }} || true
204
209
git commit -m "ci: update requirements and Dockerfile" || true
205
- git push origin ${{ env.HEAD_REF }} || true
206
210
echo "::notice::${{ matrix.app }} - updated requirement files and ${{ env.DOCKERFILE }}s"
207
211
208
212
rm -f requirements.txt gpu-requirements.txt || true
@@ -214,6 +218,7 @@ jobs:
214
218
215
219
if [ $exitcode -ne 0 ]; then
216
220
echo "::error::pip-compile failed with exit code $exitcode"
221
+ git push origin ${{ env.HEAD_REF }} || true
217
222
exit $exitcode
218
223
fi
219
224
0 commit comments