Skip to content

Commit d21f15b

Browse files
committed
Build WAF image in pipeline
1 parent d3c3c8d commit d21f15b

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ jobs:
107107
name=ghcr.io/${{ github.repository_owner }}/nginx-gateway-fabric/nginx,enable=${{ inputs.image == 'nginx' && github.event_name != 'pull_request' }}
108108
name=docker-mgmt.nginx.com/nginx-gateway-fabric/nginx-plus,enable=${{ inputs.image == 'plus' && github.event_name != 'pull_request' }}
109109
name=us-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/nginx-gateway-fabric/nginx-plus,enable=${{ inputs.image == 'plus' && github.event_name != 'pull_request' }}
110+
name=us-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/nginx-gateway-fabric-waf/nginx-plus,enable=${{ inputs.image == 'plus-waf' && github.event_name != 'pull_request' }}
110111
name=localhost:5000/nginx-gateway-fabric/${{ inputs.image }}
111112
flavor: |
112113
latest=${{ (inputs.tag != '' && 'true') || 'auto' }}
@@ -134,7 +135,7 @@ jobs:
134135
- name: Build Docker Image
135136
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
136137
with:
137-
file: build/Dockerfile${{ inputs.image == 'nginx' && '.nginx' || '' }}${{ inputs.image == 'plus' && '.nginxplus' || '' }}
138+
file: build/Dockerfile${{ inputs.image == 'nginx' && '.nginx' || '' }}${{ (inputs.image == 'plus' || inputs.image == 'plus-waf') && '.nginxplus' || '' }}
138139
context: "."
139140
target: ${{ inputs.image == 'ngf' && 'goreleaser' || '' }}
140141
tags: ${{ steps.meta.outputs.tags }}
@@ -152,6 +153,8 @@ jobs:
152153
NJS_DIR=internal/controller/nginx/modules/src
153154
NGINX_CONF_DIR=internal/controller/nginx/conf
154155
BUILD_AGENT=gha
156+
${{ inputs.image == 'plus-waf' && 'ALPINE_VERSION=3.19' || '' }}
157+
${{ inputs.image == 'plus-waf' && 'INCLUDE_NAP_WAF=true' || '' }}
155158
secrets: |
156159
${{ contains(inputs.image, 'plus') && format('"nginx-repo.crt={0}"', secrets.NGINX_CRT) || '' }}
157160
${{ contains(inputs.image, 'plus') && format('"nginx-repo.key={0}"', secrets.NGINX_KEY) || '' }}

.github/workflows/ci.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,20 @@ jobs:
222222
id-token: write # for docker/login to login to NGINX registry
223223
secrets: inherit
224224

225+
build-plus-waf:
226+
name: Build Plus WAF images
227+
needs: [vars, binary]
228+
uses: ./.github/workflows/build.yml
229+
with:
230+
image: plus-waf
231+
platforms: "linux/amd64"
232+
permissions:
233+
contents: read # for docker/build-push-action to read repo content
234+
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
235+
packages: write # for docker/build-push-action to push to GHCR
236+
id-token: write # for docker/login to login to NGINX registry
237+
secrets: inherit
238+
225239
functional-tests:
226240
name: Functional tests
227241
needs: [vars, build-oss, build-plus]

0 commit comments

Comments
 (0)