1
1
name: publish
2
2
on:
3
+ workflow_dispatch:
3
4
workflow_call:
4
5
inputs:
5
6
image_tag:
6
7
default: "devel"
7
8
required: false
8
9
type: string
10
+ registry:
11
+ default: "docker.io/intel"
12
+ required: false
13
+ type: string
9
14
env:
10
15
no_base_check: "['intel-qat-plugin-kerneldrv', 'intel-idxd-config-initcontainer', 'crypto-perf', 'opae-nlb-demo']"
11
16
12
17
permissions:
13
18
contents: read
19
+ id-token: write
14
20
15
21
jobs:
16
22
image:
@@ -20,27 +26,27 @@ jobs:
20
26
fail-fast: false
21
27
matrix:
22
28
image:
23
- - intel-fpga-admissionwebhook
24
- - intel-fpga-initcontainer
25
- - intel-gpu-initcontainer
29
+ # - intel-fpga-admissionwebhook
30
+ # - intel-fpga-initcontainer
31
+ # - intel-gpu-initcontainer
26
32
- intel-gpu-plugin
27
- - intel-fpga-plugin
28
- - intel-qat-initcontainer
29
- - intel-qat-plugin
30
- - intel-deviceplugin-operator
31
- - intel-sgx-admissionwebhook
32
- - intel-sgx-plugin
33
- - intel-sgx-initcontainer
34
- - intel-dsa-plugin
35
- - intel-iaa-plugin
36
- - intel-idxd-config-initcontainer
37
- - intel-dlb-plugin
38
- - intel-dlb-initcontainer
39
- - intel-xpumanager-sidecar
33
+ # - intel-fpga-plugin
34
+ # - intel-qat-initcontainer
35
+ # - intel-qat-plugin
36
+ # - intel-deviceplugin-operator
37
+ # - intel-sgx-admissionwebhook
38
+ # - intel-sgx-plugin
39
+ # - intel-sgx-initcontainer
40
+ # - intel-dsa-plugin
41
+ # - intel-iaa-plugin
42
+ # - intel-idxd-config-initcontainer
43
+ # - intel-dlb-plugin
44
+ # - intel-dlb-initcontainer
45
+ # - intel-xpumanager-sidecar
40
46
41
47
# # Demo images
42
- - crypto-perf
43
- - opae-nlb-demo
48
+ # - crypto-perf
49
+ # - opae-nlb-demo
44
50
steps:
45
51
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
46
52
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5
@@ -52,21 +58,57 @@ jobs:
52
58
env:
53
59
IMAGE_NAME: ${{ matrix.image }}
54
60
run: |
55
- REG=intel/ make ${IMAGE_NAME} BUILDER=docker
61
+ ORG=${{ inputs.registry }} TAG=${{ inputs.image_tag }} make ${IMAGE_NAME} BUILDER=docker
62
+ - name: List images
63
+ run: docker images
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:
77
+ registry: ghcr.io
69
78
username: ${{ secrets.DOCKERHUB_USER }}
70
79
password: ${{ secrets.DOCKERHUB_PASS }}
71
- - name: Push
72
- run: docker push intel/${{ matrix.image }}:${{ inputs.image_tag }}
80
+ - name: Push & Pull
81
+ run: |
82
+ docker push ${{ inputs.registry }}/${{ matrix.image }}:${{ inputs.image_tag }}
83
+ docker pull ${{ inputs.registry }}/${{ matrix.image }}:${{ inputs.image_tag }}
84
+ - name: Get image digest
85
+ if: ${{ inputs.image_tag != 'devel' }}
86
+ id: digest
87
+ run: |
88
+ echo "image_sha=$(docker inspect --format='{{index .RepoDigests 0}}' ${{ inputs.registry }}/${{ matrix.image }}:${{ inputs.image_tag }})" >> $GITHUB_OUTPUT
89
+ - name: Install OIDC Client from Core Package
90
+ run: npm install @actions/
[email protected] @actions/http-client
91
+ - name: Get Id Token
92
+ uses: actions/github-script@v6
93
+ id: idtoken
94
+ with:
95
+ script: |
96
+ const coredemo = require('@actions/core')
97
+ let id_token = await coredemo.getIDToken()
98
+ coredemo.setOutput('id_token', id_token)
99
+ - run: |
100
+ echo ${{ steps.idtoken.id_token }}
101
+ - name: Install cosign
102
+ if: ${{ inputs.image_tag != 'devel' }}
103
+
104
+ - name: Keyless image sign
105
+ if: ${{ inputs.image_tag != 'devel' }}
106
+ env:
107
+ COSIGN_EXPERIMENTAL: 1
108
+ run: |
109
+ echo ${{ steps.digest.outputs.image_sha }}
110
+ cosign sign --yes ${{ inputs.registry }}/${{ matrix.image }}:${{ inputs.image_tag }}
111
+ #cosign sign --yes ${{ steps.digest.outputs.image_sha }}
112
+ #- name: Verify the image signing
113
+ # run: |
114
+ # cosign verify --rekor-url "https://rekor.sigstore.dev/" ${{ steps.digest.outputs.image_sha }} --certificate-identity "https://github.com/saintmalik/sign-container-images/.github/workflows/keyless.yaml@refs/heads/main" --certificate-oidc-issuer "https://token.actions.githubusercontent.com" | jq .
0 commit comments