13
13
GH_TOKEN : ${{ secrets.GH_TOKEN }}
14
14
15
15
jobs :
16
- pi-compile :
17
- name : ' Parent Images: Compile Requirements '
16
+ pi-diff :
17
+ name : ' Parent Images: Diff PI Types '
18
18
runs-on : ubuntu-latest
19
19
environment : dev
20
20
env :
21
21
PYTHON_VERSION : ${{ vars.PYTHON_VERSION }}
22
22
outputs :
23
- updated_parent_types : ${{ steps.run-compile .outputs.updated_parent_types }}
23
+ updated_parent_types : ${{ steps.get-diff .outputs.updated_parent_types }}
24
24
steps :
25
- - name : Checkout repository
25
+ - name : Checkout Repository
26
26
uses : actions/checkout@v4
27
27
with :
28
28
repository : ${{ github.repository_owner }}/refinery-submodule-parent-images
@@ -34,60 +34,16 @@ jobs:
34
34
- name : Clone cicd-deployment-scripts
35
35
run : git clone --branch parent-images https://github.com/code-kern-ai/cicd-deployment-scripts.git
36
36
37
- - name : Set up Python
38
- uses : actions/setup-python@v5
39
- with :
40
- python-version : ${{ env.PYTHON_VERSION }}
41
-
42
- - name : Install dependencies
43
- run : python -m pip install pip-tools
44
-
45
- - name : Run compile
46
- id : run-compile
37
+ - name : Get Diff Types
38
+ id : get-diff
47
39
run : |
48
- bash cicd-deployment-scripts/pi/compile .sh \
40
+ bash cicd-deployment-scripts/pi/diff .sh \
49
41
-p "${{ github.event.pull_request.number }}"
50
42
51
- # pi-upload-artifacts:
52
- # name: 'Parent Images: Upload Artifacts'
53
- # runs-on: ubuntu-latest
54
- # needs: pi-compile
55
- # environment: dev
56
- # env:
57
- # PYTHON_VERSION: ${{ vars.PYTHON_VERSION }}
58
- # strategy:
59
- # matrix:
60
- # parent_image_type: ${{ fromJson(needs.pi-compile.outputs.updated_parent_types) }}
61
- # steps:
62
- # - name: Checkout repository
63
- # uses: actions/checkout@v4
64
- # with:
65
- # repository: ${{ github.repository_owner }}/refinery-submodule-parent-images
66
- # ref: ${{ github.event.pull_request.head.ref }}
67
-
68
- # - name: Set up Python
69
- # uses: actions/setup-python@v5
70
- # with:
71
- # python-version: ${{ env.PYTHON_VERSION }}
72
-
73
- # - name: Install dependencies
74
- # run: python -m pip install pip-tools
75
-
76
- # - name: Compile Artifacts
77
- # run: pip-compile requirements/${{ matrix.parent_image_type }}-requirements.in
78
-
79
- # # Save plan to artifacts
80
- # - name: Upload ${{ matrix.parent_image_type }}-requirements
81
- # uses: actions/upload-artifact@v4
82
- # with:
83
- # name: ${{ matrix.parent_image_type }}-requirements.txt
84
- # path: requirements/${{ matrix.parent_image_type }}-requirements.txt
85
- # if-no-files-found: error
86
-
87
43
pi-build :
88
44
name : ' Parent Images: Docker Build'
89
45
runs-on : ubuntu-latest
90
- needs : [pi-compile ]
46
+ needs : [pi-diff ]
91
47
environment : dev
92
48
env :
93
49
PYTHON_VERSION : ${{ vars.PYTHON_VERSION }}
@@ -97,50 +53,42 @@ jobs:
97
53
IMAGE_TAG : ${{ github.event_name == 'release' && github.event.release.tag_name || github.event.pull_request.head.ref }}
98
54
strategy :
99
55
matrix :
100
- parent_image_type : ${{ fromJson(needs.pi-compile .outputs.updated_parent_types) }}
56
+ parent_image_type : ${{ fromJson(needs.pi-diff .outputs.updated_parent_types) }}
101
57
steps :
102
58
- name : Checkout repository
103
59
uses : actions/checkout@v4
104
60
with :
105
61
repository : ' ${{ github.repository_owner }}/refinery-${{ matrix.parent_image_type }}-parent-image'
106
62
submodules : ' true'
107
63
fetch-depth : 0
108
-
64
+
65
+ - name : GitHub Configuration
66
+ run : git config --global url."https://oauth2:${{ secrets.GH_TOKEN }}@github.com".insteadOf https://github.com
67
+
109
68
- name : Set up Python
110
69
uses : actions/setup-python@v5
111
70
with :
112
71
python-version : ${{ env.PYTHON_VERSION }}
113
72
114
- - name : Install dependencies
73
+ - name : Install Dependencies
115
74
run : python -m pip install pip-tools
116
75
117
- # - name: Update submodules
118
- # run: |
119
- # echo "ls -l: $(pwd)"
120
- # ls -l
121
- # # cat ${{ github.workspace }}/submodules/parent-images/requirements/${{ matrix.parent_image_type }}-requirements.txt
122
- # cd submodules
123
- # echo "ls -l: $(pwd)"
124
- # ls -l
125
- # cd parent-images
126
- # echo "ls -l: $(pwd)"
127
- # ls -l
128
-
129
76
- name : Compile Artifacts
130
77
run : |
131
78
cd ${{ github.workspace }}/submodules/parent-images
132
- git checkout ${{ github.event.pull_request.head.sha }}
79
+ git checkout ${{ github.event.pull_request.head.ref }}
133
80
pip-compile requirements/${{ matrix.parent_image_type }}-requirements.in
134
-
135
- # # Download requirements from artifacts
136
- # - name: Download ${{ matrix.parent_image_type }}-requirements
137
- # uses: actions/download-artifact@v4
138
- # with:
139
- # name: ${{ matrix.parent_image_type }}-requirements.txt
140
- # path: ${{ github.workspace }}/submodules/parent-images/requirements
141
-
142
- # - name: GitHub Configuration
143
- # run: git config --global url."https://oauth2:${{ secrets.GH_TOKEN }}@github.com".insteadOf https://github.com
81
+ cd ${{ github.workspace }}
82
+ git checkout -b ${{ github.event.pull_request.head.ref }}
83
+ git add submodules
84
+ git commit -m "${{ github.event.pull_request.title }}"
85
+ git push origin ${{ github.event.pull_request.head.ref }}
86
+ gh pr create \
87
+ --title "${{ github.event.pull_request.title }}" \
88
+ --body "${{ github.event.pull_request.body }}" \
89
+ --base dev \
90
+ --head ${{ github.event.pull_request.head.ref }} \
91
+ --repo ${{ github.repository_owner }}/refinery-${{ matrix.parent_image_type }}-parent-image
144
92
145
93
# - name: Clone cicd-deployment-scripts
146
94
# run: git clone --branch parent-images https://github.com/code-kern-ai/cicd-deployment-scripts.git
0 commit comments