-
-
Notifications
You must be signed in to change notification settings - Fork 27
78 lines (72 loc) · 1.97 KB
/
release-job-image.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Release Job-Image
on:
workflow_call:
inputs:
branch:
required: false
default: main
type: string
version:
required: true
type: string
docker-tags:
required: false
type: string
default: ""
docker-platforms:
required: false
default: linux/amd64
type: string
cosign-repository:
required: false
default: ""
type: string
job-image:
required: true
default: ""
type: string
secrets:
token:
required: true
pat:
required: true
ghcr-password:
required: false
jobs:
release-job-image:
permissions:
id-token: write
contents: write
packages: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@6d193bf28034eafb982f37bd894289fe649468fc
with:
fetch-depth: 0
token: ${{ secrets.pat }}
- name: Setup Cosign
uses: sigstore/cosign-installer@4959ce089c160fddf62f7b42464195ba1a56d382
- name: Setup Syft
uses: ckotzbauer/actions-toolkit/setup-syft@0.46.0
- name: Build and push image
uses: ckotzbauer/actions-toolkit/docker@0.46.0
with:
ghcr-password: ${{ secrets.ghcr-password }}
dockerhub-user: ${{ secrets.dockerhub-user }}
dockerhub-password: ${{ secrets.dockerhub-password }}
context: job-images/${{ inputs.job-image }}
push: true
sign: true
verify: true
cosign-repository: ${{ inputs.cosign-repository }}
platforms: ${{ inputs.docker-platforms }}
tags: ${{ inputs.docker-tags }}
- name: Generate SBOM
uses: ckotzbauer/actions-toolkit/sbom@0.46.0
with:
images: ${{ inputs.docker-tags }}
sign: true
verify: true
attest: true
cosign-repository: ${{ inputs.cosign-repository }}