12
12
# See the License for the specific language governing permissions and
13
13
# limitations under the License.
14
14
15
- # ###################################################################################################
16
- # Secrets
17
- # # ACTION_TOKEN
18
- # # MLOPS_REF
19
- # # MLOPS_REPO
20
- # # REGISTRY
21
- # # REGISTRY_TOKEN
22
- # # REGISTRY_USER
23
- # # REPO
24
- # ###################################################################################################
25
15
name : Container CI
26
16
permissions : read-all
27
17
on :
75
65
required : true
76
66
type : string
77
67
jobs :
78
- # ###################################################################################################
79
- # Compose Build
80
- # ###################################################################################################
68
+ # ###################################################################################################
69
+ # Compose Build
70
+ # ###################################################################################################
81
71
setup-build :
82
72
outputs :
83
73
matrix : ${{ steps.build-matrix.outputs.matrix }}
103
93
strategy :
104
94
matrix : ${{ fromJson(needs.setup-build.outputs.matrix) }}
105
95
fail-fast : false
106
- outputs :
107
- group : ${{ steps.build-group.outputs.container-group }}
108
96
steps :
109
97
- uses : actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
110
98
with :
@@ -128,66 +116,6 @@ jobs:
128
116
no-push : ${{ inputs.no_push }}
129
117
no-start : ${{ inputs.no_start }}
130
118
# ###################################################################################################
131
- # Trivy Scan
132
- # ###################################################################################################
133
- setup-scan :
134
- needs : [build-containers]
135
- runs-on : ubuntu-latest
136
- outputs :
137
- matrix : ${{ steps.scan-matrix.outputs.matrix }}
138
- steps :
139
- - name : Harden Runner
140
- uses : step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
141
- with :
142
- egress-policy : audit
143
- - uses : actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
144
- with :
145
- path : matrix
146
- - name : Set Matrix
147
- id : scan-matrix
148
- run : echo "matrix=$(cat matrix/*-${{ needs.build-containers.outputs.group }}/*.txt | jq -R '.' | jq -sc '. | unique')" >> $GITHUB_OUTPUT
149
- scan-containers :
150
- needs : [setup-scan]
151
- if : ${{ !inputs.no_build }}
152
- runs-on : k8-runners
153
- # permissions:
154
- # actions: read
155
- # packages: read
156
- # pull-requests: write
157
- # security-events: write
158
- strategy :
159
- matrix :
160
- container : ${{ fromJSON(needs.setup-scan.outputs.matrix) }}
161
- fail-fast : false
162
- steps :
163
- - uses : actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
164
- with :
165
- ref : ${{ inputs.ref }}
166
- - uses : docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
167
- with :
168
- registry : ${{ secrets.REGISTRY }}
169
- username : ${{ secrets.REGISTRY_USER }}
170
- password : ${{ secrets.REGISTRY_TOKEN }}
171
- - name : Pull Image
172
- run : docker pull ${{ secrets.REGISTRY }}/${{ secrets.REPO }}:${{ matrix.container }}
173
- - name : Scan Container
174
- uses : intel/ai-containers/.github/scan@5c68c9c8ff7f634fff3abcc17c46970e0b9b0dde # main
175
- with :
176
- image-ref : ${{ secrets.REGISTRY }}/${{ secrets.REPO }}:${{ matrix.container }}
177
- output : ${{ matrix.container }}-scan.sarif
178
- - name : Cleanup
179
- if : always()
180
- run : docker rmi -f ${{ secrets.REGISTRY }}/${{ secrets.REPO }}:${{ matrix.container }}
181
- - uses : actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
182
- with :
183
- name : ${{ matrix.container }}-scan
184
- path : ${{ matrix.container }}-scan.sarif
185
- # - uses: github/codeql-action/upload-sarif@2e230e8fe0ad3a14a340ad0815ddb96d599d2aff # v3.25.8
186
- # with:
187
- # sarif_file: '${{ matrix.container }}-scan.sarif'
188
- # category: '${{ matrix.container }}'
189
- # continue-on-error: true
190
- # ###################################################################################################
191
119
# Generic Test Runner
192
120
# ###################################################################################################
193
121
setup-test :
0 commit comments