Skip to content

Commit e6df726

Browse files
authored
Change to F5 runners for release builds (#600)
1 parent bf98603 commit e6df726

File tree

3 files changed

+301
-79
lines changed

3 files changed

+301
-79
lines changed

.github/workflows/ci.yml

Lines changed: 35 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ on:
44
push:
55
branches:
66
- main
7-
tags:
8-
- "v[0-9]+.[0-9]+.[0-9]+"
97
pull_request:
108
branches:
119
- main
@@ -21,13 +19,38 @@ permissions:
2119
contents: read
2220

2321
jobs:
22+
variables:
23+
name: Set Variables
24+
runs-on: ubuntu-24.04
25+
outputs:
26+
runner: ${{ steps.vars.outputs.runner }}
27+
version: ${{ steps.vars.outputs.version }}
28+
chart_version: ${{ steps.vars.outputs.chart_version }}
29+
openshift_version: ${{ steps.vars.outputs.openshift_version }}
30+
steps:
31+
- name: Checkout Repository
32+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
33+
34+
- name: Output Variables
35+
id: vars
36+
run: |
37+
runner=ubuntu-24.04
38+
if [ "${{ github.event_name }}" == "push" ]; then
39+
runner=ubuntu-24.04-amd64
40+
fi
41+
echo "runner=$runner" >> $GITHUB_OUTPUT
42+
echo "version=$(git describe --tags)" >> $GITHUB_OUTPUT
43+
echo "chart_version=$(yq '.appVersion' <helm-charts/nginx-ingress/Chart.yaml)" >> $GITHUB_OUTPUT
44+
echo "openshift_version=$(yq '.annotations["com.redhat.openshift.versions"]' <bundle/metadata/annotations.yaml | cut -dv -f2)" >> $GITHUB_OUTPUT
45+
2446
build:
2547
name: Build Image
26-
runs-on: ubuntu-24.04
48+
runs-on: ${{ needs.variables.outputs.runner }}
49+
needs: [variables]
2750
outputs:
2851
version: ${{ steps.meta.outputs.version }}
2952
permissions:
30-
contents: write # for lucacome/draft-release to create a draft release
53+
contents: read
3154
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
3255
packages: write # for docker/build-push-action to push to GHCR
3356
steps:
@@ -66,13 +89,6 @@ jobs:
6689
- name: Docker Buildx
6790
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
6891

69-
- name: Output Variables
70-
id: vars
71-
run: |
72-
echo "version=$(git describe --tags)" >> $GITHUB_OUTPUT
73-
echo "chart_version=$(yq '.appVersion' <helm-charts/nginx-ingress/Chart.yaml)" >> $GITHUB_OUTPUT
74-
echo "openshift_version=$(yq '.annotations["com.redhat.openshift.versions"]' <bundle/metadata/annotations.yaml | cut -dv -f2)" >> $GITHUB_OUTPUT
75-
7692
- name: Docker meta
7793
id: meta
7894
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0
@@ -84,14 +100,13 @@ jobs:
84100
tags: |
85101
type=edge
86102
type=ref,event=pr
87-
type=semver,pattern={{version}}
88103
labels: |
89104
org.opencontainers.image.documentation=https://docs.nginx.com/nginx-ingress-controller
90105
org.opencontainers.image.vendor=NGINX Inc <[email protected]>
91106
name="NGINX Ingress Operator"
92107
maintainer="[email protected]"
93108
vendor="NGINX Inc"
94-
version=${{ steps.vars.outputs.version }}
109+
version=${{ needs.variables.outputs.version }}
95110
release=1
96111
summary="The NGINX Ingress Operator is a Kubernetes/OpenShift component which deploys and manages one or more NGINX/NGINX Plus Ingress Controllers"
97112
description="The NGINX Ingress Operator is a Kubernetes/OpenShift component which deploys and manages one or more NGINX/NGINX Plus Ingress Controllers"
@@ -120,30 +135,32 @@ jobs:
120135
format: "sarif"
121136
output: "trivy-results.sarif"
122137
ignore-unfixed: "true"
138+
if: github.event_name != 'pull_request'
123139

124140
- name: Upload Trivy scan results to GitHub Security tab
125141
uses: github/codeql-action/upload-sarif@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # v3.30.6
126142
continue-on-error: true
127143
with:
128144
sarif_file: "trivy-results.sarif"
145+
if: github.event_name != 'pull_request'
129146

130147
- name: Upload Scan Results
131148
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
132149
continue-on-error: true
133150
with:
134151
name: "trivy-results.sarif"
135152
path: "trivy-results.sarif"
136-
if: always()
153+
if: github.event_name != 'pull_request'
137154

138155
- name: Create/Update Draft
139156
uses: lucacome/draft-release@fd099feb33710d1fa27b915a08a7acd6a1fb7fd2 # v2.0.0
140157
with:
141158
minor-label: "enhancement"
142159
major-label: "change"
143-
publish: ${{ github.ref_type == 'tag' }}
160+
publish: false
144161
variables: |
145-
nic_version=${{ steps.vars.outputs.chart_version }}
146-
openshift_version=${{ steps.vars.outputs.openshift_version }}
162+
nic_version=${{ needs.variables.outputs.chart_version }}
163+
openshift_version=${{ needs.variables.outputs.openshift_version }}
147164
notes-footer: |
148165
## Compatibility
149166
@@ -156,65 +173,4 @@ jobs:
156173
uses: ./.github/workflows/e2e-test.yml
157174
needs: build
158175
with:
159-
operator_version: ${{ github.ref_type == 'tag' && needs.build.outputs.version || 'edge' }}
160-
161-
certify:
162-
name: Certify for Red Hat OpenShift
163-
runs-on: ubuntu-24.04
164-
needs: [build, e2e-test]
165-
if: ${{ github.ref_type == 'tag' }}
166-
env:
167-
preflight_version: 1.14.1 # renovate: datasource=github-releases depName=preflight packageName=redhat-openshift-ecosystem/openshift-preflight
168-
steps:
169-
- name: Checkout Repository
170-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
171-
172-
- name: Certify Images
173-
continue-on-error: false
174-
run: |
175-
curl -fsSL https://github.com/redhat-openshift-ecosystem/openshift-preflight/releases/download/${{ env.preflight_version }}/preflight-linux-amd64 --output preflight
176-
chmod +x preflight
177-
178-
IFS=',' read -ra arch_list <<< "${{ env.platforms }}"
179-
180-
for arch in "${arch_list[@]}"; do
181-
architecture=("${arch#*/}")
182-
./preflight check container quay.io/nginx/nginx-ingress-operator:${{ needs.build.outputs.version }} --pyxis-api-token ${{ secrets.PYXIS_API_TOKEN }} --certification-project-id ${{ secrets.CERTIFICATION_PROJECT_ID }} --platform $architecture --submit
183-
done
184-
185-
## Disable PR creation until issues with NGINX_PAT are resolved
186-
# - name: Make
187-
# run: |
188-
# make bundle USE_IMAGE_DIGESTS=true
189-
190-
# - name: Checkout certified-operators repo
191-
# uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
192-
# with:
193-
# token: ${{ secrets.NGINX_PAT }}
194-
# repository: nginx-bot/certified-operators
195-
# path: certified-operators
196-
197-
# - name: Update certified-operators repo
198-
# working-directory: certified-operators/operators/nginx-ingress-operator
199-
# run: |
200-
# mkdir v${{ needs.build.outputs.version }}
201-
# cp -R ../../../bundle/manifests v${{ needs.build.outputs.version }}/
202-
# cp -R ../../../bundle/metadata v${{ needs.build.outputs.version }}/
203-
204-
# - name: Commit changes
205-
# uses: stefanzweifel/git-auto-commit-action@b863ae1933cb653a53c021fe36dbb774e1fb9403 # v5.2.0
206-
# with:
207-
# commit_message: operator nginx-ingress-operator (v${{ needs.build.outputs.version }})
208-
# commit_author: nginx-bot <[email protected]>
209-
# commit_user_name: nginx-bot
210-
# commit_user_email: [email protected]
211-
# create_branch: true
212-
# branch: update-nginx-ingress-operator-to-v${{ needs.build.outputs.version }}
213-
# repository: certified-operators
214-
215-
# - name: Create PR
216-
# working-directory: certified-operators
217-
# run: |
218-
# gh pr create --title "operator nginx-ingress-operator (v${{ needs.build.outputs.version }})" --body "Update nginx-ingress-operator to v${{ needs.build.outputs.version }}" --head nginx-bot:update-nginx-ingress-operator-to-v${{ needs.build.outputs.version }} --base main --repo redhat-openshift-ecosystem/certified-operators
219-
# env:
220-
# GITHUB_TOKEN: ${{ secrets.NGINX_PAT }}
176+
operator_version: ${{ needs.build.outputs.version }}

.github/workflows/e2e-test.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,35 @@ jobs:
3636
- name: Checkout Repository
3737
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3838

39+
- name: Check if image exists
40+
id: image_exists
41+
run: |
42+
exists=false
43+
if docker pull nginx/nginx-ingress-operator:${{ env.OPERATOR_VERSION }}; then
44+
exists=true
45+
fi
46+
echo "exists=${exists}" >> $GITHUB_OUTPUT
47+
48+
- name: Docker Buildx
49+
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
50+
if: steps.image_exists.outputs.exists == 'false'
51+
52+
- name: Build Image
53+
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
54+
with:
55+
context: "."
56+
cache-from: type=gha
57+
cache-to: type=gha,mode=max
58+
tags: nginx/nginx-ingress-operator:${{ env.OPERATOR_VERSION }}
59+
platforms: ${{ github.event_name != 'pull_request' && env.platforms || '' }}
60+
load: true
61+
push: false
62+
no-cache: ${{ github.event_name != 'pull_request' }}
63+
pull: true
64+
sbom: false
65+
provenance: false
66+
if: steps.image_exists.outputs.exists == 'false'
67+
3968
- name: Get Latest Versions
4069
run: |
4170
# Get latest supported Kubernetes version from Minikube
@@ -68,6 +97,7 @@ jobs:
6897
- name: Start Minikube
6998
run: |
7099
minikube start --kubernetes-version=${{ env.KUBERNETES_VERSION }} --driver=docker --memory=4g --cpus=2
100+
minikube image load nginx/nginx-ingress-operator:${{ env.OPERATOR_VERSION }}
71101
72102
- name: Verify Kubernetes cluster
73103
run: |

0 commit comments

Comments
 (0)