3131 with :
3232 checkout_ref : parent-image-updates
3333 repository : " ${{ github.repository_owner }}/refinery-submodule-parent-images"
34+ edit_dockerfile : true
3435
3536 pi-build :
3637 name : ' Parent Images: Docker Build'
3940 environment : dev
4041 env :
4142 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 }}
4546 PARENT_IMAGE_NAME : ${{ vars.PARENT_IMAGE_NAME }}
4647 DOCKERFILE : ${{ vars.DOCKERFILE }}
4748 HEAD_REF : parent-image-updates
@@ -83,22 +84,22 @@ jobs:
8384 with :
8485 platforms : arm64,arm
8586
86- - name : Log into DockerHub registry
87+ - name : Log into DEV registry
8788 uses : docker/login-action@v3
8889 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 }}"
9293
9394 - name : Build & Push ${{ env.PARENT_IMAGE_NAME }}:${{ env.HEAD_REF }}-${{ matrix.parent_image_type }}
9495 uses : docker/build-push-action@v5
9596 with :
9697 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
99100 platforms : linux/amd64
100101 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 }}
102103 push : true
103104 build-args : |
104105 platform=linux/amd64
@@ -108,11 +109,11 @@ jobs:
108109 uses : docker/build-push-action@v5
109110 with :
110111 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
113114 platforms : linux/arm64
114115 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
116117 push : true
117118 build-args : |
118119 platform=linux/arm64
@@ -127,6 +128,7 @@ jobs:
127128 env :
128129 PYTHON_VERSION : ${{ vars.PYTHON_VERSION }}
129130 DOCKERHUB_CONTAINER_REGISTRY : ${{ vars.DOCKERHUB_CONTAINER_REGISTRY }}
131+ DEV_CONTAINER_REGISTRY : ${{ vars.DEV_CONTAINER_REGISTRY }}
130132 PARENT_IMAGE_NAME : ${{ vars.PARENT_IMAGE_NAME }}
131133 DOCKERFILE : ${{ vars.DOCKERFILE }}
132134 HEAD_REF : parent-image-updates
@@ -180,13 +182,15 @@ jobs:
180182 -i "${{ env.PARENT_IMAGE_NAME }}" \
181183 -l "${{ env.HEAD_REF }}" \
182184 -r "${{ env.DOCKERHUB_CONTAINER_REGISTRY }}" \
185+ -e "${{ env.DEV_CONTAINER_REGISTRY }}" \
183186 -d "${{ env.DOCKERFILE }}"
184187
185188 if [ -f "dev.${{ env.DOCKERFILE }}" ]; then
186189 bash ${{ github.workspace }}/cicd-deployment-scripts/pi/edit_dockerfile.sh \
187190 -i "${{ env.PARENT_IMAGE_NAME }}" \
188191 -l "${{ env.HEAD_REF }}" \
189192 -r "${{ env.DOCKERHUB_CONTAINER_REGISTRY }}" \
193+ -e "${{ env.DEV_CONTAINER_REGISTRY }}" \
190194 -d "dev.${{ env.DOCKERFILE }}"
191195 fi
192196
@@ -195,14 +199,14 @@ jobs:
195199 -i "${{ env.PARENT_IMAGE_NAME }}" \
196200 -l "${{ env.HEAD_REF }}" \
197201 -r "${{ env.DOCKERHUB_CONTAINER_REGISTRY }}" \
202+ -e "${{ env.DEV_CONTAINER_REGISTRY }}" \
198203 -d "gpu.${{ env.DOCKERFILE }}"
199204 fi
200205
201206 git add requirements/*.txt ${{ env.DOCKERFILE }}
202207 git add dev.${{ env.DOCKERFILE }} || true
203208 git add gpu.${{ env.DOCKERFILE }} || true
204209 git commit -m "ci: update requirements and Dockerfile" || true
205- git push origin ${{ env.HEAD_REF }} || true
206210 echo "::notice::${{ matrix.app }} - updated requirement files and ${{ env.DOCKERFILE }}s"
207211
208212 rm -f requirements.txt gpu-requirements.txt || true
@@ -214,6 +218,7 @@ jobs:
214218
215219 if [ $exitcode -ne 0 ]; then
216220 echo "::error::pip-compile failed with exit code $exitcode"
221+ git push origin ${{ env.HEAD_REF }} || true
217222 exit $exitcode
218223 fi
219224
0 commit comments