13
13
GH_TOKEN : ${{ secrets.GH_TOKEN }}
14
14
15
15
jobs :
16
+ configure-branch-name :
17
+ name : ' Configure Head Branch Name'
18
+ runs-on : ubuntu-latest
19
+ outputs :
20
+ gh_head_ref : ${{ steps.configure-branch-name.outputs.gh_head_ref }}
21
+ steps :
22
+ - name : Configure branch name
23
+ id : configure-branch-name
24
+ run : echo "gh_head_ref=$(echo "${{ github.event.pull_request.head.ref }}" | sed 's|/|-|g')" >> $GITHUB_OUTPUT
25
+
16
26
pi-matrix :
17
27
uses : code-kern-ai/cicd-deployment-scripts/.github/workflows/pi_matrix.yml@dev
18
28
secrets : inherit
29
+ needs : [configure-branch-name]
19
30
with :
20
- checkout_ref : ${{ github.event.pull_request.head.ref }}
31
+ checkout_ref : ${{ needs.configure-branch-name.outputs.gh_head_ref }}
21
32
repository : " ${{ github.repository_owner }}/refinery-submodule-parent-images"
22
33
23
34
pi-build :
24
35
name : ' Parent Images: Docker Build'
25
36
runs-on : ubuntu-latest
26
- needs : [pi-matrix]
37
+ needs : [pi-matrix, configure-branch-name ]
27
38
environment : dev
28
39
env :
29
40
PYTHON_VERSION : ${{ vars.PYTHON_VERSION }}
30
41
DEV_CONTAINER_REGISTRY : ${{ vars.DEV_CONTAINER_REGISTRY }}
31
42
DEV_LOGIN_USERNAME : ${{ secrets.DEV_LOGIN_USERNAME }}
32
43
DEV_LOGIN_PASSWORD : ${{ secrets.DEV_LOGIN_PASSWORD }}
33
- IMAGE_TAG : ${{ github.event_name == 'release' && github.event.release.tag_name || github.event.pull_request.head.ref }}
44
+ IMAGE_TAG : ${{ github.event_name == 'release' && github.event.release.tag_name || needs.configure-branch-name.outputs.gh_head_ref }}
34
45
strategy :
35
46
matrix :
36
47
parent_image_type : ${{ fromJson(needs.pi-matrix.outputs.parent_image_type) }}
54
65
- name : Compile Requirements
55
66
run : |
56
67
cd ${{ github.workspace }}/submodules/parent-images
57
- git checkout ${{ github.event.pull_request.head.ref }}
68
+ git checkout ${{ needs.configure-branch-name.outputs.gh_head_ref }}
58
69
pip-compile requirements/${{ matrix.parent_image_type }}-requirements.in
59
70
60
71
- name : Set up Docker Buildx
@@ -74,29 +85,29 @@ jobs:
74
85
username : " ${{ env.DEV_LOGIN_USERNAME }}"
75
86
password : " ${{ env.DEV_LOGIN_PASSWORD }}"
76
87
77
- - name : Build & Push refinery-parent-images:${{ github.event.pull_request.head.ref }}-${{ matrix.parent_image_type }}
88
+ - name : Build & Push refinery-parent-images:${{ needs.configure-branch-name.outputs.gh_head_ref }}-${{ matrix.parent_image_type }}
78
89
uses : docker/build-push-action@v5
79
90
with :
80
91
context : .
81
- cache-from : type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ github.event.pull_request.head.ref }}-${{ matrix.parent_image_type }}-cache
82
- cache-to : type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ github.event.pull_request.head.ref }}-${{ matrix.parent_image_type }}-cache,mode=max,image-manifest=true
92
+ cache-from : type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ needs.configure-branch-name.outputs.gh_head_ref }}-${{ matrix.parent_image_type }}-cache
93
+ cache-to : type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ needs.configure-branch-name.outputs.gh_head_ref }}-${{ matrix.parent_image_type }}-cache,mode=max,image-manifest=true
83
94
platforms : linux/amd64
84
95
file : Dockerfile
85
- tags : ${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ github.event.pull_request.head.ref }}-${{ matrix.parent_image_type }}
96
+ tags : ${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ needs.configure-branch-name.outputs.gh_head_ref }}-${{ matrix.parent_image_type }}
86
97
push : true
87
98
build-args : |
88
99
platform=linux/amd64
89
100
label=dockerfile-path=https://github.com/refinery-${{ matrix.parent_image_type }}-parent-image/blob/${{ github.sha }}/Dockerfile
90
101
91
- - name : Build & Push refinery-parent-images:${{ github.event.pull_request.head.ref }}-${{ matrix.parent_image_type }}-arm64
102
+ - name : Build & Push refinery-parent-images:${{ needs.configure-branch-name.outputs.gh_head_ref }}-${{ matrix.parent_image_type }}-arm64
92
103
uses : docker/build-push-action@v5
93
104
with :
94
105
context : .
95
- cache-from : type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ github.event.pull_request.head.ref }}-${{ matrix.parent_image_type }}-arm64-cache
96
- cache-to : type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ github.event.pull_request.head.ref }}-${{ matrix.parent_image_type }}-arm64-cache,mode=max,image-manifest=true
106
+ cache-from : type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ needs.configure-branch-name.outputs.gh_head_ref }}-${{ matrix.parent_image_type }}-arm64-cache
107
+ cache-to : type=registry,ref=${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ needs.configure-branch-name.outputs.gh_head_ref }}-${{ matrix.parent_image_type }}-arm64-cache,mode=max,image-manifest=true
97
108
platforms : linux/arm64
98
109
file : Dockerfile
99
- tags : ${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ github.event.pull_request.head.ref }}-${{ matrix.parent_image_type }}-arm64
110
+ tags : ${{ env.DEV_CONTAINER_REGISTRY }}/refinery-parent-images:${{ needs.configure-branch-name.outputs.gh_head_ref }}-${{ matrix.parent_image_type }}-arm64
100
111
push : true
101
112
build-args : |
102
113
platform=linux/arm64
0 commit comments