|
6 | 6 | default: "devel" |
7 | 7 | required: false |
8 | 8 | type: string |
| 9 | + registry: |
| 10 | + default: "docker.io/intel" |
| 11 | + required: false |
| 12 | + type: string |
9 | 13 | env: |
10 | 14 | no_base_check: "['intel-qat-plugin-kerneldrv', 'intel-idxd-config-initcontainer', 'crypto-perf', 'opae-nlb-demo']" |
11 | 15 |
|
12 | 16 | permissions: |
13 | 17 | contents: read |
| 18 | + id-token: write |
14 | 19 |
|
15 | 20 | jobs: |
16 | 21 | image: |
17 | 22 | name: Build image |
18 | | - runs-on: ubuntu-24.04 |
| 23 | + runs-on: ubuntu-22.04 |
| 24 | + permissions: |
| 25 | + contents: read |
| 26 | + id-token: write |
19 | 27 | strategy: |
20 | 28 | fail-fast: false |
21 | 29 | matrix: |
@@ -52,21 +60,33 @@ jobs: |
52 | 60 | env: |
53 | 61 | IMAGE_NAME: ${{ matrix.image }} |
54 | 62 | run: | |
55 | | - REG=intel/ make ${IMAGE_NAME} BUILDER=docker |
| 63 | + ORG=${{ inputs.registry }} TAG=${{ inputs.image_tag }} make ${IMAGE_NAME} BUILDER=docker |
56 | 64 | - name: Trivy scan for image |
57 | 65 | uses: aquasecurity/trivy-action@6e7b7d1fd3e4fef0c5fa8cce1229c54b2c9bd0d8 # 0.24.0 |
58 | 66 | with: |
59 | 67 | scan-type: image |
60 | | - image-ref: intel/${{ matrix.image }}:${{ inputs.image_tag }} |
| 68 | + image-ref: ${{ inputs.registry }}/${{ matrix.image }}:${{ inputs.image_tag }} |
61 | 69 | exit-code: 1 |
62 | 70 | - name: Test image base layer |
63 | 71 | # Don't run base layer check for selected images |
64 | 72 | if: ${{ !contains(fromJson(env.no_base_check), matrix.image) }} |
65 | | - run: IMG=intel/${{ matrix.image }}:${{ inputs.image_tag }} make test-image-base-layer BUILDER=docker |
| 73 | + run: IMG=${{ inputs.registry }}/${{ matrix.image }}:${{ inputs.image_tag }} make test-image-base-layer BUILDER=docker |
66 | 74 | - name: Login |
67 | 75 | uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3 |
68 | 76 | with: |
69 | 77 | username: ${{ secrets.DOCKERHUB_USER }} |
70 | 78 | password: ${{ secrets.DOCKERHUB_PASS }} |
71 | 79 | - name: Push |
72 | | - run: docker push intel/${{ matrix.image }}:${{ inputs.image_tag }} |
| 80 | + run: docker push ${{ inputs.registry }}/${{ matrix.image }}:${{ inputs.image_tag }} |
| 81 | + - name: Get image digest |
| 82 | + if: ${{ inputs.image_tag != 'devel' }} |
| 83 | + id: digest |
| 84 | + run: | |
| 85 | + echo "image_sha=$(docker inspect --format='{{index .RepoDigests 0}}' ${{ inputs.registry }}/${{ matrix.image }}:${{ inputs.image_tag }})" >> $GITHUB_OUTPUT |
| 86 | + - name: Install cosign |
| 87 | + if: ${{ inputs.image_tag != 'devel' }} |
| 88 | + uses: sigstore/cosign-installer@4959ce089c160fddf62f7b42464195ba1a56d382 #v3.6.0 |
| 89 | + - name: Keyless image sign |
| 90 | + if: ${{ inputs.image_tag != 'devel' }} |
| 91 | + run: | |
| 92 | + cosign sign --yes ${{ steps.digest.outputs.image_sha }} |
0 commit comments