27
27
publish-image :
28
28
required : false
29
29
type : boolean
30
+ publish-aws-market-place :
31
+ required : false
32
+ type : boolean
33
+ publish-gcp-market-place :
34
+ required : false
35
+ type : boolean
36
+ publish-nginx-reqistry :
37
+ required : false
38
+ type : boolean
39
+ forked-workflow :
40
+ required : false
41
+ type : boolean
30
42
31
43
defaults :
32
44
run :
@@ -70,15 +82,15 @@ jobs:
70
82
token_format : access_token
71
83
workload_identity_provider : ${{ secrets.GCR_WORKLOAD_IDENTITY }}
72
84
service_account : ${{ secrets.GCR_SERVICE_ACCOUNT }}
73
- if : ${{ inputs.publish-image || github.event.pull_request.head.repo.full_name == github.repository }}
85
+ if : ${{ inputs.publish-image || ! inputs.forked-workflow }}
74
86
75
87
- name : Login to GCR
76
88
uses : docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
77
89
with :
78
90
registry : gcr.io
79
91
username : oauth2accesstoken
80
92
password : ${{ steps.auth.outputs.access_token }}
81
- if : ${{ inputs.publish-image || github.event.pull_request.head.repo.full_name == github.repository }}
93
+ if : ${{ inputs.publish-image || ! inputs.forked-workflow }}
82
94
83
95
- name : Authenticate to Google Cloud Marketplace
84
96
id : auth-mktpl
@@ -87,28 +99,27 @@ jobs:
87
99
token_format : access_token
88
100
workload_identity_provider : ${{ secrets.GCR_WORKLOAD_IDENTITY_MKTPL }}
89
101
service_account : ${{ secrets.GCR_SERVICE_ACCOUNT_MKTPL }}
90
- if : github.ref_type == 'tag' && ! contains( inputs.target, 'aws')
102
+ if : ${{ inputs.publish-gcp-market-place }}
91
103
92
104
- name : Login to GCR for Marketplace
93
105
uses : docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
94
106
with :
95
107
registry : gcr.io
96
108
username : oauth2accesstoken
97
109
password : ${{ steps.auth-mktpl.outputs.access_token }}
98
- if : github.ref_type == 'tag' && ! contains( inputs.target, 'aws')
110
+ if : ${{ inputs.publish-gcp-market-place }}
99
111
100
112
- name : Configure AWS Credentials
101
113
uses : aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
102
114
with :
103
115
aws-region : us-east-1
104
116
role-to-assume : ${{ secrets.AWS_ROLE_MARKETPLACE }}
105
- if : github.ref_type == 'tag' && contains(inputs.target, 'aws')
106
-
117
+ if : ${{ inputs.publish-aws-market-place }}
107
118
- name : Login to ECR
108
119
uses : docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
109
120
with :
110
121
registry : 709825985650.dkr.ecr.us-east-1.amazonaws.com
111
- if : github.ref_type == 'tag' && contains( inputs.target, ' aws')
122
+ if : ${{ inputs.publish- aws-market-place }}
112
123
113
124
- name : Get Id Token
114
125
uses : actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
@@ -117,25 +128,25 @@ jobs:
117
128
script : |
118
129
let id_token = await core.getIDToken()
119
130
core.setOutput('id_token', id_token)
120
- if : ${{ inputs.publish-image }}
131
+ if : ${{ inputs.publish-nginx-reqistry }}
121
132
122
133
- name : Login to NGINX Registry
123
134
uses : docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
124
135
with :
125
136
registry : docker-mgmt.nginx.com
126
137
username : ${{ steps.idtoken.outputs.id_token }}
127
138
password : ${{ github.actor }}
128
- if : ${{ inputs.publish-image }}
139
+ if : ${{ inputs.publish-nginx-reqistry }}
129
140
130
141
- name : Docker meta
131
142
id : meta
132
143
uses : docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
133
144
with :
134
145
images : |
135
146
name=gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic${{ contains(inputs.nap_modules, 'dos') && '-dos' || '' }}${{ contains(inputs.nap_modules, 'waf') && '-nap' || '' }}/nginx-plus-ingress
136
- name=gcr.io/f5-7626-networks-public/nginxinc/nginx-plus-ingress${{ contains(inputs.nap_modules, 'waf') && '-nap' || '' }}${{ contains(inputs.nap_modules, 'dos') && '-dos' || '' }},enable=${{ github.ref_type == 'tag' && ! contains(inputs.target, 'aws') && ! contains(inputs.image, 'alpine') && ! contains(inputs.image, 'ubi') }}
137
- name=docker-mgmt.nginx.com/nginx-ic${{ contains(inputs.nap_modules, 'waf') && '-nap' || '' }}${{ contains(inputs.nap_modules, 'dos') && '-dos' || '' }}/nginx-plus-ingress,enable=${{ github.ref_type != 'pull_request' && ! startsWith(github.ref, 'refs/heads/release-') && ! contains(inputs.target, 'aws') }}
138
- name=709825985650.dkr.ecr.us-east-1.amazonaws.com/nginx/nginx-plus-ingress${{ contains(inputs.nap_modules, 'dos') && '-dos' || '' }}${{ contains(inputs.nap_modules, 'waf') && '-nap' || '' }},enable=${{ github.ref_type == 'tag' && contains(inputs.target, 'aws') }}
147
+ name=gcr.io/f5-7626-networks-public/nginxinc/nginx-plus-ingress${{ contains(inputs.nap_modules, 'waf') && '-nap' || '' }}${{ contains(inputs.nap_modules, 'dos') && '-dos' || '' }},enable=${{ inputs.publish-gcp-market-place && ! contains(inputs.target, 'aws') && ! contains(inputs.image, 'alpine') && ! contains(inputs.image, 'ubi') }}
148
+ name=docker-mgmt.nginx.com/nginx-ic${{ contains(inputs.nap_modules, 'waf') && '-nap' || '' }}${{ contains(inputs.nap_modules, 'dos') && '-dos' || '' }}/nginx-plus-ingress,enable=${{ inputs.publish-nginx-reqistry && ! contains(inputs.target, 'aws') }}
149
+ name=709825985650.dkr.ecr.us-east-1.amazonaws.com/nginx/nginx-plus-ingress${{ contains(inputs.nap_modules, 'dos') && '-dos' || '' }}${{ contains(inputs.nap_modules, 'waf') && '-nap' || '' }},enable=${{ inputs.publish-aws-market-place && contains(inputs.target, 'aws') }}
139
150
flavor : |
140
151
suffix=${{ contains(inputs.image, 'ubi') && '-ubi' || '' }}${{ contains(inputs.image, 'alpine') && '-alpine' || '' }}${{ contains(inputs.target, 'aws') && '-mktpl' || '' }}${{ contains(inputs.image, 'fips') && '-fips' || ''}},onlatest=true
141
152
latest=${{ contains(inputs.target, 'aws') && 'false' || 'auto' }}
@@ -165,7 +176,7 @@ jobs:
165
176
context : " ."
166
177
cache-from : type=gha,scope=${{ inputs.image }}${{ contains(inputs.nap_modules, 'dos') && '-dos' || '' }}${{ contains(inputs.nap_modules, 'waf') && '-nap' || '' }}
167
178
cache-to : type=gha,scope=${{ inputs.image }}${{ contains(inputs.nap_modules, 'dos') && '-dos' || '' }}${{ contains(inputs.nap_modules, 'waf') && '-nap' || '' }},mode=max
168
- target : ${{ inputs.target }}${{ github.event.pull_request.head.repo.full_name == github.repository && '-prebuilt' || '' }}
179
+ target : ${{ inputs.target }}${{ ! inputs.forked-workflow && '-prebuilt' || '' }}
169
180
tags : ${{ steps.meta.outputs.tags }}
170
181
labels : ${{ steps.meta.outputs.labels }}
171
182
annotations : ${{ inputs.publish-image && steps.meta.outputs.annotations || '' }}
@@ -203,7 +214,7 @@ jobs:
203
214
echo "version=$version" >> $GITHUB_OUTPUT
204
215
echo "product_code=AWS${nap}_PRODUCT_ID" >> $GITHUB_OUTPUT
205
216
echo "registry=${aws_registry}" >> $GITHUB_OUTPUT
206
- if : github.ref_type == 'tag' && contains( inputs.target, ' aws')
217
+ if : ${{ inputs.publish- aws-market-place }}
207
218
208
219
- name : Publish to AWS Marketplace
209
220
uses : nginxinc/aws-marketplace-publish@be512a7ae9666098bc4429a1afa27a11be6a3995 # v1.0.3
@@ -220,7 +231,7 @@ jobs:
220
231
This container requires Kubernetes and can be deployed to EKS.
221
232
Review the installation instructions https://docs.nginx.com/nginx-ingress-controller/installation/ and utilize the deployment resources available https://github.com/nginxinc/kubernetes-ingress/tree/master/deployments
222
233
Use this image instead of building your own.
223
- if : ${{ github.ref_type == 'tag' && contains( inputs.target, ' aws') }}
234
+ if : ${{ inputs.publish- aws-market-place }}
224
235
225
236
- name : Extract image name for Trivy
226
237
id : trivy-tag
0 commit comments