1
- name : Continuous Integration
1
+ name : CI
2
2
3
3
on :
4
4
push :
@@ -30,28 +30,9 @@ concurrency:
30
30
cancel-in-progress : true
31
31
32
32
jobs :
33
-
34
- vars :
35
- name : Get variables
36
- runs-on : ubuntu-20.04
37
- outputs :
38
- sha_short : ${{ steps.vars.outputs.sha }}
39
- repo_name : ${{ steps.vars.outputs.repo }}
40
- version : ${{ steps.vars.outputs.version }}
41
- steps :
42
- - name : Checkout Repository
43
- uses : actions/checkout@v3
44
- - name : Output Variables
45
- id : vars
46
- run : |
47
- echo "::set-output name=sha::$(echo ${GITHUB_SHA} | cut -c1-7)"
48
- echo "::set-output name=repo::$(echo ${GITHUB_REPOSITORY} | cut -d '/' -f 2)"
49
- echo "::set-output name=version::$(echo ${GITHUB_REF} | cut -d '/' -f 2)"
50
-
51
33
build :
52
34
name : Build Image
53
35
runs-on : ubuntu-20.04
54
- needs : vars
55
36
steps :
56
37
- name : Checkout Repository
57
38
uses : actions/checkout@v3
@@ -70,37 +51,46 @@ jobs:
70
51
username : ${{ github.repository_owner }}
71
52
password : ${{ secrets.GITHUB_TOKEN }}
72
53
if : github.event_name != 'pull_request'
54
+ - name : Login to Quay.io
55
+ uses : docker/login-action@v2
56
+ with :
57
+ registry : quay.io
58
+ username : ${{ secrets.QUAY_USERNAME }}
59
+ password : ${{ secrets.QUAY_ROBOT_TOKEN }}
60
+ if : github.event_name != 'pull_request'
73
61
- name : Setup QEMU
74
62
uses : docker/setup-qemu-action@v2
75
63
with :
76
64
platforms : arm64,ppc64le,s390x
77
65
if : github.event_name != 'pull_request'
78
66
- name : Docker Buildx
79
67
uses : docker/setup-buildx-action@v2
68
+ - name : Output Variables
69
+ id : vars
70
+ run : |
71
+ echo "version=$(git describe --tags)" >> $GITHUB_OUTPUT
80
72
- name : Docker meta
81
73
id : meta
82
74
uses : docker/metadata-action@v4
83
75
with :
84
76
images : |
85
77
nginx/nginx-ingress-operator
86
78
ghcr.io/nginxinc/nginx-ingress-operator
79
+ quay.io/nginx/nginx-ingress-operator
87
80
tags : |
88
81
type=edge
89
82
type=ref,event=pr
90
83
type=semver,pattern={{version}}
91
84
labels : |
92
85
org.opencontainers.image.documentation=https://docs.nginx.com/nginx-ingress-controller
93
86
org.opencontainers.image.vendor=NGINX Inc <[email protected] >
94
- - name : Output Variables
95
- id : var
96
- run : |
97
- version=latest
98
- if ${{ startsWith(github.ref, 'refs/tags/') }}; then
99
- operator_version=v${{ needs.vars.outputs.version }}
100
- else
101
- operator_version=$version-${{ needs.vars.outputs.sha_short }}
102
- fi
103
- echo "::set-output name=version::$operator_version"
87
+ name="NGINX Ingress Operator"
88
+
89
+ vendor="NGINX Inc"
90
+ version=${{ steps.vars.outputs.version }}
91
+ release=1
92
+ summary="The NGINX Ingress Operator is a Kubernetes/OpenShift component which deploys and manages one or more NGINX/NGINX Plus Ingress Controllers"
93
+ description="The NGINX Ingress Operator is a Kubernetes/OpenShift component which deploys and manages one or more NGINX/NGINX Plus Ingress Controllers"
104
94
- name : Build Image
105
95
uses : docker/build-push-action@v3
106
96
with :
@@ -112,9 +102,8 @@ jobs:
112
102
platforms : ${{ github.event_name != 'pull_request' && env.platforms || '' }}
113
103
load : ${{ github.event_name == 'pull_request' }}
114
104
push : ${{ github.event_name != 'pull_request' }}
105
+ no-cache : ${{ github.event_name != 'pull_request' }}
115
106
pull : true
116
- build-args : |
117
- VERSION=${{ steps.var.outputs.version }}
118
107
- name : Run Trivy vulnerability scanner
119
108
uses :
aquasecurity/[email protected]
120
109
continue-on-error : true
@@ -135,52 +124,3 @@ jobs:
135
124
name : ' trivy-results.sarif'
136
125
path : ' trivy-results.sarif'
137
126
if : always()
138
-
139
-
140
- notify :
141
- name : Notify
142
- runs-on : ubuntu-20.04
143
- needs : [vars, build]
144
- if : always() && github.ref == 'refs/heads/main'
145
- steps :
146
- - name : Workflow Status
147
- id : check
148
- uses : martialonline/workflow-status@v3
149
- - name : Send Notification
150
- uses : 8398a7/action-slack@v3
151
- if : steps.check.outputs.status == 'failure'
152
- with :
153
- status : custom
154
- custom_payload : |
155
- {
156
- username: 'Github',
157
- icon_emoji: ':octocat:',
158
- mention: 'channel',
159
- attachments: [{
160
- title: '${{ needs.vars.outputs.repo_name }} ${{ github.workflow }} pipeline has failed',
161
- color: '${{ steps.check.outputs.status }}' == 'failure' ? 'danger' : 'warning',
162
- fields: [{
163
- title: 'Commit Hash',
164
- value: '${{ needs.vars.outputs.sha_short }}',
165
- short: true
166
- },
167
- {
168
- title: 'Author',
169
- value: '${{ github.actor }}',
170
- short: true
171
- },
172
- {
173
- title: 'Commit Message',
174
- value: `${{ github.event.head_commit.message }}`,
175
- short: false
176
- },
177
- {
178
- title: 'Pipeline URL',
179
- value: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}',
180
- short: false
181
- }]
182
- }]
183
- }
184
- env :
185
- GITHUB_TOKEN : ${{ github.token }}
186
- SLACK_WEBHOOK_URL : ${{ secrets.SLACK_WEBHOOK }}
0 commit comments