15
15
nap_modules :
16
16
required : false
17
17 type : string
18
+ release-url :
19
+ required : false
20
+ type : string
18
21
19
22
defaults :
20
23
run :
49
52
if : github.event_name != 'pull_request'
50
53
51
54
- name : Docker Buildx
52
- uses : docker/setup-buildx-action@ecf95283f03858871ff00b787d79c419715afc34 # v2.7.0
55
+ uses : docker/setup-buildx-action@4c0219f9ac95b02789c1075625400b2acbff50b1 # v2.9.1
53
56
54
57
- name : Authenticate to Google Cloud
55
58
id : auth
@@ -73,22 +76,22 @@ jobs:
73
76
with :
74
77
aws-region : us-east-1
75
78
role-to-assume : ${{ secrets.AWS_ROLE_MARKETPLACE }}
76
- if : startsWith( github.ref, 'refs/tags/') && contains(inputs.target, 'aws')
79
+ if : github.ref_type == 'tag' && contains(inputs.target, 'aws')
77
80
78
81
- name : Login to ECR
79
82
uses : docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0
80
83
with :
81
84
registry : 709825985650.dkr.ecr.us-east-1.amazonaws.com
82
- if : startsWith( github.ref, 'refs/tags/') && contains(inputs.target, 'aws')
85
+ if : github.ref_type == 'tag' && contains(inputs.target, 'aws')
83
86
84
87
- name : Docker meta
85
88
id : meta
86
89
uses : docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175 # v4.6.0
87
90
with :
88
91
images : |
89
92
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
90
- name=gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/release/nginx-ic${{ contains(inputs.nap_modules, 'dos') && '-dos' || '' }}${{ contains(inputs.nap_modules, 'waf') && '-nap' || '' }}/nginx-plus-ingress,enable=${{ startsWith( github.ref, 'refs/tags/') }}
91
- 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=${{ startsWith( github.ref, 'refs/tags/') && contains(inputs.target, 'aws') }}
93
+ name=gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/release/nginx-ic${{ contains(inputs.nap_modules, 'dos') && '-dos' || '' }}${{ contains(inputs.nap_modules, 'waf') && '-nap' || '' }}/nginx-plus-ingress,enable=${{ github.ref_type == 'tag' }}
94
+ 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') }}
92
95
flavor : |
93
96
suffix=${{ contains(inputs.image, 'ubi') && '-ubi' || '' }}${{ contains(inputs.image, 'alpine') && '-alpine' || '' }}${{ contains(inputs.target, 'aws') && '-mktpl' || '' }}${{ contains(inputs.image, 'fips') && '-fips' || ''}},onlatest=true
94
97
latest=${{ contains(inputs.target, 'aws') && 'false' || 'auto' }}
@@ -106,12 +109,7 @@ jobs:
106
109
- name : NAP modules
107
110
id : nap_modules
108
111
run : |
109
- modules=""
10A08
;
110
- if [[ "${{ inputs.nap_modules }}" == "waf,dos" ]]; then
111
- modules="both"
112
- else
113
- modules="${{ inputs.nap_modules }}"
114
- fi
112
+ [[ "${{ inputs.nap_modules }}" == "waf,dos" ]] && modules="both" || modules="${{ inputs.nap_modules }}"
115
113
echo "modules=${modules}" >> $GITHUB_OUTPUT
116
114
if : ${{ inputs.nap_modules != '' }}
117
115
@@ -134,14 +132,49 @@ jobs:
134
132
provenance : false
135
133
build-args : |
136
134
BUILD_OS=${{ inputs.image }}
137
- IC_VERSION=${{ startsWith( github.ref, 'refs/tags/') && steps.meta.outputs.version || 'CI' }}
135
+ IC_VERSION=${{ github.ref_type == 'tag' && steps.meta.outputs.version || 'CI' }}
138
136
${{ inputs.nap_modules != '' && format('NAP_MODULES={0}', inputs.nap_modules) || '' }}
139
137
${{ steps.nap_modules.outputs.modules != '' && format('NAP_MODULES_AWS={0}', steps.nap_modules.outputs.modules) || '' }}
140
138
secrets : |
141
139
"nginx-repo.crt=${{ inputs.nap_modules != '' && secrets.NGINX_AP_CRT || secrets.NGINX_CRT }}"
142
140
"nginx-repo.key=${{ inputs.nap_modules != '' && secrets.NGINX_AP_KEY || secrets.NGINX_KEY }}"
143
141
${{ inputs.nap_modules != '' && contains(inputs.image, 'ubi') && format('"rhel_license={0}"', secrets.RHEL_LICENSE) || '' }}
144
142
143
+ - name : AWS variables
144
+ id : aws
145
+ run : |
146
+ aws_registry=$(echo "${{ steps.meta.outputs.tags }}" | grep -oP "709825985650.dkr.ecr.us-east-1.amazonaws.com/[^[:space:]]+")
147
+ version=$(echo ${{ steps.meta.outputs.version }} | sed 's/-mktpl//')
148
+ declare -A nap_mapping=(
149
+ ["waf"]=_NAP_WAF
150
+ ["dos"]=_NAP_DOS
151
+ ["waf,dos"]=_NAP_WAF_DOS
152
+ )
153
+ modules=${{ inputs.nap_modules }}
154
+ [[ -n $modules && ${nap_mapping[$modules]+_} ]] && nap=${nap_mapping[$modules]}
155
+
156
+ echo "version=$version" >> $GITHUB_OUTPUT
157
+ echo "product_code=AWS${nap}_PRODUCT_ID" >> $GITHUB_OUTPUT
158
+ echo "registry=${aws_registry}" >> $GITHUB_OUTPUT
159
+ if : github.ref_type == 'tag' && contains(inputs.target, 'aws')
160
+
161
+ - name : Publish to AWS Marketplace
162
+ uses : nginxinc/aws-marketplace-publish@93e03c5ce4baa842a8e5baad0a3f35d07b38460c # v0.1.2
163
+ continue-on-error : true
164
+ with :
165
+ version : ${{ steps.aws.outputs.version }}
166
+ product-id : ${{ secrets[steps.aws.outputs.product_code] }}
167
+ registry : ${{ steps.aws.outputs.registry }}
168
+ release-notes : ${{ inputs.release-url }}
169
+ description : |
170
+ Best-in-class traffic management solution for services in Amazon EKS.
171
+ This is the official implementation of NGINX Ingress Controller (based on NGINX Plus) from NGINX.
172
+ usage-instructions : |
173
+ This container requires Kubernetes and can be deployed to EKS.
174
+ 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
175
+ Use this image instead of building your own.
176
+ if : ${{ github.ref_type == 'tag' && contains(inputs.target, 'aws') }}
177
+
145
178
- name : Load image for Trivy
146
179
uses : docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825 # v4.1.1
147
180
with :
@@ -153,7 +186,7 @@ jobs:
153
186
load : true
154
187
build-args : |
155
188
BUILD_OS=${{ inputs.image }}
156
- IC_VERSION=${{ startsWith( github.ref, 'refs/tags/') && steps.meta.outputs.version || 'CI' }}
189
+ IC_VERSION=${{ github.ref_type == 'tag' && steps.meta.outputs.version || 'CI' }}
157
190
${{ inputs.nap_modules != '' && format('NAP_MODULES={0}', inputs.nap_modules) || '' }}
158
191
${{ steps.nap_modules.outputs.modules != '' && format('NAP_MODULES_AWS={0}', steps.nap_modules.outputs.modules) || '' }}
159
192
secrets : |
@@ -171,7 +204,7 @@ jobs:
171
204
ignore-unfixed : " true"
172
205
173
206
- name : Upload Trivy scan results to GitHub Security tab
174
- uses : github/codeql-action/upload-sarif@f6e388ebf0efc915c6c5b165b019ee61a6746a38 # v2.20.1
207
+ uses : github/codeql-action/upload-sarif@a09933a12a80f87b87005513f0abb1494c27a716 # v2.21.4
175
208
continue-on-error : true
176
209
with :
177
210
sarif_file : " trivy-results-${{ inputs.image }}.sarif"
0 commit comments