Skip to content

Commit a881663

Browse files
committed
fix: pi-matrix for input parent_iamge_type
1 parent b9d827b commit a881663

File tree

2 files changed

+18
-36
lines changed

2 files changed

+18
-36
lines changed

.github/workflows/pi_merge_parent_image.yml

+17-35
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
DEV_CONTAINER_REGISTRY: ${{ vars.DEV_CONTAINER_REGISTRY }}
4141
DEV_LOGIN_USERNAME: ${{ secrets.DEV_LOGIN_USERNAME }}
4242
DEV_LOGIN_PASSWORD: ${{ secrets.DEV_LOGIN_PASSWORD }}
43+
PARENT_IMAGE_NAME: ${{ vars.PARENT_IMAGE_NAME }}
4344
PARENT_IMAGE_TYPE: ${{ vars.PARENT_IMAGE_TYPE }}
4445
DOCKERFILE: ${{ vars.DOCKERFILE }}
4546
steps:
@@ -78,57 +79,57 @@ jobs:
7879
username: "${{ env.DEV_LOGIN_USERNAME }}"
7980
password: "${{ env.DEV_LOGIN_PASSWORD }}"
8081

81-
- name: Build & Push refinery-parent-images:${{ github.event.pull_request.base.ref }}-${{ env.PARENT_IMAGE_TYPE }}
82+
- name: Build & Push ${{ env.PARENT_IMAGE_NAME }}:${{ github.event.pull_request.base.ref }}-${{ env.PARENT_IMAGE_TYPE }}
8283
uses: docker/build-push-action@v5
8384
with:
8485
context: .
85-
cache-from: type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ github.event.pull_request.base.ref }}-${{ env.PARENT_IMAGE_TYPE }}-cache
86-
cache-to: type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ github.event.pull_request.base.ref }}-${{ env.PARENT_IMAGE_TYPE }}-cache,mode=max,image-manifest=true
86+
cache-from: type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/${{ env.PARENT_IMAGE_NAME }}:${{ github.event.pull_request.base.ref }}-${{ env.PARENT_IMAGE_TYPE }}-cache
87+
cache-to: type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/${{ env.PARENT_IMAGE_NAME }}:${{ github.event.pull_request.base.ref }}-${{ env.PARENT_IMAGE_TYPE }}-cache,mode=max,image-manifest=true
8788
platforms: linux/amd64
8889
file: ${{ env.DOCKERFILE }}
89-
tags: ${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ github.event.pull_request.base.ref }}-${{ env.PARENT_IMAGE_TYPE }}
90+
tags: ${{ env.DEV_CONTAINER_REGISTRY }}/${{ env.PARENT_IMAGE_NAME }}:${{ github.event.pull_request.base.ref }}-${{ env.PARENT_IMAGE_TYPE }}
9091
push: true
9192
build-args: |
9293
platform=linux/amd64
9394
label=dockerfile-path=https://github.com/refinery-${{ env.PARENT_IMAGE_TYPE }}-parent-image/blob/${{ github.sha }}/Dockerfile
9495
95-
- name: Build & Push refinery-parent-images:${{ github.event.pull_request.base.ref }}-${{ env.PARENT_IMAGE_TYPE }}-arm64
96+
- name: Build & Push ${{ env.PARENT_IMAGE_NAME }}:${{ github.event.pull_request.base.ref }}-${{ env.PARENT_IMAGE_TYPE }}-arm64
9697
uses: docker/build-push-action@v5
9798
with:
9899
context: .
99-
cache-from: type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ github.event.pull_request.base.ref }}-${{ env.PARENT_IMAGE_TYPE }}-arm64-cache
100-
cache-to: type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ github.event.pull_request.base.ref }}-${{ env.PARENT_IMAGE_TYPE }}-arm64-cache,mode=max,image-manifest=true
100+
cache-from: type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/${{ env.PARENT_IMAGE_NAME }}:${{ github.event.pull_request.base.ref }}-${{ env.PARENT_IMAGE_TYPE }}-arm64-cache
101+
cache-to: type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/${{ env.PARENT_IMAGE_NAME }}:${{ github.event.pull_request.base.ref }}-${{ env.PARENT_IMAGE_TYPE }}-arm64-cache,mode=max,image-manifest=true
101102
platforms: linux/arm64
102103
file: ${{ env.DOCKERFILE }}
103-
tags: ${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ github.event.pull_request.base.ref }}-${{ env.PARENT_IMAGE_TYPE }}-arm64
104+
tags: ${{ env.DEV_CONTAINER_REGISTRY }}/${{ env.PARENT_IMAGE_NAME }}:${{ github.event.pull_request.base.ref }}-${{ env.PARENT_IMAGE_TYPE }}-arm64
104105
push: true
105106
build-args: |
106107
platform=linux/arm64
107108
label=dockerfile-path=https://github.com/refinery-${{ env.PARENT_IMAGE_TYPE }}-parent-image/blob/${{ github.sha }}/Dockerfile
108109
109-
- name: Build & Push refinery-parent-images:sha-${{ env.PARENT_IMAGE_TYPE }}
110+
- name: Build & Push ${{ env.PARENT_IMAGE_NAME }}:sha-${{ env.PARENT_IMAGE_TYPE }}
110111
uses: docker/build-push-action@v5
111112
with:
112113
context: .
113-
cache-from: type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ github.sha }}-${{ env.PARENT_IMAGE_TYPE }}-cache
114-
cache-to: type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ github.sha }}-${{ env.PARENT_IMAGE_TYPE }}-cache,mode=max,image-manifest=true
114+
cache-from: type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/${{ env.PARENT_IMAGE_NAME }}:${{ github.sha }}-${{ env.PARENT_IMAGE_TYPE }}-cache
115+
cache-to: type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/${{ env.PARENT_IMAGE_NAME }}:${{ github.sha }}-${{ env.PARENT_IMAGE_TYPE }}-cache,mode=max,image-manifest=true
115116
platforms: linux/amd64
116117
file: ${{ env.DOCKERFILE }}
117-
tags: ${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ github.sha }}-${{ env.PARENT_IMAGE_TYPE }}
118+
tags: ${{ env.DEV_CONTAINER_REGISTRY }}/${{ env.PARENT_IMAGE_NAME }}:${{ github.sha }}-${{ env.PARENT_IMAGE_TYPE }}
118119
push: true
119120
build-args: |
120121
platform=linux/amd64
121122
label=dockerfile-path=https://github.com/refinery-${{ env.PARENT_IMAGE_TYPE }}-parent-image/blob/${{ github.sha }}/Dockerfile
122123
123-
- name: Build & Push refinery-parent-images:sha-${{ env.PARENT_IMAGE_TYPE }}-arm64
124+
- name: Build & Push ${{ env.PARENT_IMAGE_NAME }}:sha-${{ env.PARENT_IMAGE_TYPE }}-arm64
124125
uses: docker/build-push-action@v5
125126
with:
126127
context: .
127-
cache-from: type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ github.sha }}-${{ env.PARENT_IMAGE_TYPE }}-arm64-cache
128-
cache-to: type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ github.sha }}-${{ env.PARENT_IMAGE_TYPE }}-arm64-cache,mode=max,image-manifest=true
128+
cache-from: type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/${{ env.PARENT_IMAGE_NAME }}:${{ github.sha }}-${{ env.PARENT_IMAGE_TYPE }}-arm64-cache
129+
cache-to: type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/${{ env.PARENT_IMAGE_NAME }}:${{ github.sha }}-${{ env.PARENT_IMAGE_TYPE }}-arm64-cache,mode=max,image-manifest=true
129130
platforms: linux/arm64
130131
file: ${{ env.DOCKERFILE }}
131-
tags: ${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ github.sha }}-${{ env.PARENT_IMAGE_TYPE }}-arm64
132+
tags: ${{ env.DEV_CONTAINER_REGISTRY }}/${{ env.PARENT_IMAGE_NAME }}:${{ github.sha }}-${{ env.PARENT_IMAGE_TYPE }}-arm64
132133
push: true
133134
build-args: |
134135
platform=linux/arm64
@@ -251,22 +252,3 @@ jobs:
251252
- name: Delete Branch
252253
shell: bash
253254
run: git push origin --delete ${{ github.event.pull_request.head.ref }}
254-
255-
gh-delete-app-branches:
256-
name: 'GitHub: Delete Branch'
257-
needs: [pi-matrix, pi-update-app]
258-
if: ${{ !failure() }}
259-
runs-on: ubuntu-latest
260-
strategy:
261-
matrix:
262-
include: ${{ fromJson(needs.pi-matrix.outputs.include) }}
263-
steps:
264-
- name: Checkout repository
265-
uses: actions/checkout@v4
266-
with:
267-
token: ${{ secrets.GH_TOKEN }}
268-
repository: '${{ github.repository_owner }}/${{ matrix.app }}'
269-
270-
- name: Delete Branch
271-
shell: bash
272-
run: git push origin --delete ${{ github.event.pull_request.head.ref }}

pi/matrix.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ if [ -n $PR_NUMBER ] && [ -z $PARENT_IMAGE_TYPE ]; then
3131

3232
done <<< "$UPDATED_FILES"
3333
echo "::notice::Exporting matrix for parent image types: $UPDATED_PARENT_TYPES"
34-
elif [ -z $PR_NUMBER ] && [ -n $PARENT_IMAGE_TYPE ]; then
34+
elif [ -n $PARENT_IMAGE_TYPE ]; then
3535
echo "::notice::Exporting matrix for parent image type: $PARENT_IMAGE_TYPE"
3636
UPDATED_PARENT_TYPES=( $PARENT_IMAGE_TYPE )
3737
fi

0 commit comments

Comments
 (0)