Skip to content

Commit c1feaf3

Browse files
committed
sign test
Signed-off-by: Tuomas Katila <[email protected]>
1 parent 39aa15e commit c1feaf3

File tree

2 files changed

+83
-23
lines changed

2 files changed

+83
-23
lines changed

.github/workflows/lib-publish.yaml

Lines changed: 65 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
name: publish
22
on:
3+
workflow_dispatch:
34
workflow_call:
45
inputs:
56
image_tag:
67
default: "devel"
78
required: false
89
type: string
10+
registry:
11+
default: "docker.io/intel"
12+
required: false
13+
type: string
914
env:
1015
no_base_check: "['intel-qat-plugin-kerneldrv', 'intel-idxd-config-initcontainer', 'crypto-perf', 'opae-nlb-demo']"
1116

1217
permissions:
1318
contents: read
19+
id-token: write
1420

1521
jobs:
1622
image:
@@ -20,27 +26,27 @@ jobs:
2026
fail-fast: false
2127
matrix:
2228
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
2632
- 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
4046

4147
# # Demo images
42-
- crypto-perf
43-
- opae-nlb-demo
48+
#- crypto-perf
49+
#- opae-nlb-demo
4450
steps:
4551
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
4652
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5
@@ -52,21 +58,57 @@ jobs:
5258
env:
5359
IMAGE_NAME: ${{ matrix.image }}
5460
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
5664
- name: Trivy scan for image
5765
uses: aquasecurity/trivy-action@6e7b7d1fd3e4fef0c5fa8cce1229c54b2c9bd0d8 # 0.24.0
5866
with:
5967
scan-type: image
60-
image-ref: intel/${{ matrix.image }}:${{ inputs.image_tag }}
68+
image-ref: ${{ inputs.registry }}/${{ matrix.image }}:${{ inputs.image_tag }}
6169
exit-code: 1
6270
- name: Test image base layer
6371
# Don't run base layer check for selected images
6472
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
6674
- name: Login
6775
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3
6876
with:
77+
registry: ghcr.io
6978
username: ${{ secrets.DOCKERHUB_USER }}
7079
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+
uses: sigstore/[email protected]
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 .

.github/workflows/test.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Test
2+
on:
3+
workflow_dispatch:
4+
push:
5+
6+
permissions:
7+
contents: read
8+
pull-requests: read
9+
id-token: write
10+
11+
jobs:
12+
build:
13+
name: Build & Publish
14+
uses: "./.github/workflows/lib-publish.yaml"
15+
secrets: inherit
16+
with:
17+
image_tag: v9.99.9
18+
registry: ghcr.io/tkatila

0 commit comments

Comments
 (0)