6
6
platforms :
7
7
required : true
8
8
type : string
9
+ build-os :
10
+ required : false
11
+ type : string
12
+ default : ' '
9
13
image :
10
14
required : true
11
15
type : string
65
69
platforms : arm64
66
70
67
71
- name : Login to GitHub Container Registry
68
- uses : docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5 .0
72
+ uses : docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6 .0
69
73
if : ${{ github.event_name != 'pull_request' && ! contains(inputs.image, 'plus') }}
70
74
with :
71
75
registry : ghcr.io
82
86
if : ${{ github.event_name != 'pull_request' && contains(inputs.image, 'plus')}}
83
87
84
88
- name : Login to NGINX Registry
85
- uses : docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5 .0
89
+ uses : docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6 .0
86
90
with :
87
91
registry : docker-mgmt.nginx.com
88
92
username : ${{ steps.idtoken.outputs.id_token }}
99
103
if : ${{ github.event_name != 'pull_request' && contains(inputs.image, 'plus') }}
100
104
101
105
- name : Login to GAR
102
- uses : docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5 .0
106
+ uses : docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6 .0
103
107
with :
104
108
registry : us-docker.pkg.dev
105
109
username : oauth2accesstoken
@@ -116,16 +120,17 @@ jobs:
116
120
name=ghcr.io/${{ github.repository_owner }}/nginx-gateway-fabric/nginx,enable=${{ inputs.image == 'nginx' && github.event_name != 'pull_request' }}
117
121
name=docker-mgmt.nginx.com/nginx-gateway-fabric/nginx-plus,enable=${{ inputs.image == 'plus' && github.event_name != 'pull_request' }}
118
122
name=us-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/nginx-gateway-fabric/nginx-plus,enable=${{ inputs.image == 'plus' && github.event_name != 'pull_request' }}
123
+ name=ghcr.io/${{ github.repository_owner }}/nginx-gateway-fabric/operator,enable=${{ inputs.image == 'operator' && github.event_name != 'pull_request' }}
119
124
name=localhost:5000/nginx-gateway-fabric/${{ inputs.image }}
120
125
flavor : |
121
126
latest=${{ (inputs.tag != '' && 'true') || 'auto' }}
122
127
tags : |
123
- type=semver,pattern={{version}}
124
- type=edge
125
- type=schedule
126
- type=ref,event=pr
127
- type=ref,event=branch,suffix=-rc,enable=${{ startsWith(github.ref, 'refs/heads/release') && inputs.tag == '' }}
128
- type=raw,value=${{ inputs.tag }},enable=${{ inputs.tag != '' }}
128
+ type=semver,pattern={{version}},suffix=${{ inputs.build-os != '' && format('-{0}', inputs.build-os) || '' }}
129
+ type=edge,suffix=${{ inputs.build-os != '' && format('-{0}', inputs.build-os) || '' }}
130
+ type=schedule,suffix=${{ inputs.build-os != '' && format('-{0}', inputs.build-os) || '' }}
131
+ type=ref,event=pr,suffix=${{ inputs.build-os != '' && format('-{0}', inputs.build-os) || '' }}
132
+ type=ref,event=branch,suffix=-rc${{ inputs.build-os != '' && format('-{0}', inputs.build-os) || '' }} ,enable=${{ startsWith(github.ref, 'refs/heads/release') && inputs.tag == '' }}
133
+ type=raw,value=${{ inputs.tag }},enable=${{ inputs.tag != '' }},suffix=${{ inputs.build-os != '' && format('-{0}', inputs.build-os) || '' }}
129
134
labels : |
130
135
org.opencontainers.image.documentation=https://docs.nginx.com/nginx-gateway-fabric
131
136
org.opencontainers.image.vendor=NGINX Inc <[email protected] >
@@ -143,16 +148,16 @@ jobs:
143
148
- name : Build Docker Image
144
149
uses : docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
145
150
with :
146
- file : build/ Dockerfile${{ inputs.image == 'nginx' && '.nginx' || '' }}${{ inputs.image == 'plus' && '.nginxplus' || '' }}
151
+ file : ${{ inputs.image == 'operator' && 'operators/Dockerfile' || (inputs. build-os != '' && format('build/{0}/ Dockerfile{1}', inputs.build-os, inputs. image == 'nginx' && '.nginx' || inputs.image == 'plus' && '.nginxplus' || '') || format('build/Dockerfile{0}', inputs.image == 'nginx' && '.nginx' || inputs.image == ' plus' && '.nginxplus' || '')) }}
147
152
context : " ."
148
153
target : ${{ inputs.image == 'ngf' && 'goreleaser' || '' }}
149
154
tags : ${{ steps.meta.outputs.tags }}
150
155
labels : ${{ steps.meta.outputs.labels }}
151
156
annotations : ${{ steps.meta.outputs.annotations }}
152
157
push : ${{ !inputs.dry_run }}
153
158
platforms : ${{ inputs.platforms }}
154
- cache-from : type=gha,scope=${{ inputs.image }}
155
- cache-to : type=gha,scope=${{ inputs.image }},mode=max
159
+ cache-from : type=gha,scope=${{ inputs.image }}${{ inputs.build-os != '' && format('-{0}', inputs.build-os) || '' }}
160
+ cache-to : type=gha,scope=${{ inputs.image }}${{ inputs.build-os != '' && format('-{0}', inputs.build-os) || '' }} ,mode=max
156
161
pull : true
157
162
no-cache : ${{ github.event_name != 'pull_request' }}
158
163
sbom : true
@@ -182,7 +187,7 @@ jobs:
182
187
fail-build : false
183
188
184
189
- name : Upload scan result to GitHub Security tab
185
- uses : github/codeql-action/upload-sarif@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3 .30.5
190
+ uses : github/codeql-action/upload-sarif@e296a935590eb16afc0c0108289f68c87e2a89a5 # v4 .30.7
186
191
if : ${{ !inputs.dry_run }}
187
192
continue-on-error : true
188
193
with :
0 commit comments