4
4
schedule :
5
5
- cron : ' 0 0 * * *'
6
6
7
- env :
8
- IMAGE_NAME : fabiocicerchia/nginx-lua
9
-
10
7
jobs :
11
- artifacts :
12
- runs-on : ubuntu-latest
13
- steps :
14
- - uses : actions/checkout@v2
15
-
16
- - name : Archive metadata artifacts
17
- uses : actions/upload-artifact@v2
18
- with :
19
- name : metadata
20
- path : docs/metadata
21
- retention-days : 1
22
-
23
8
auto_update :
9
+ name : Auto Update
24
10
runs-on : ubuntu-latest
25
- needs : artifacts
26
- steps :
11
+ steps :
27
12
- uses : actions/checkout@v2
28
13
29
14
- name : Generate Supported Versions
@@ -33,18 +18,15 @@ jobs:
33
18
34
19
if : ${{ job.status != 'success' }}
35
20
36
-
37
21
docker_alpine :
22
+ name : Build Docker Alpine
38
23
runs-on : ubuntu-latest
39
24
needs : auto_update
40
25
steps :
41
26
- uses : actions/checkout@v2
42
27
43
- - name : Restore metadata artifacts
44
- uses : actions/download-artifact@v2
45
- with :
46
- name : metadata-alpine
47
- path : docs/metadata/*alpine*
28
+ - name : Cleanup metadata artifacts
29
+ run : rm -rf docs/metadata/*
48
30
49
31
- name : Build images
50
32
run : make build-alpine
@@ -64,20 +46,18 @@ jobs:
64
46
uses : actions/upload-artifact@v2
65
47
with :
66
48
name : metadata-alpine
67
- path : docs/metadata/*alpine*
49
+ path : docs/metadata
68
50
retention-days : 1
69
51
70
52
docker_amazonlinux :
53
+ name : Build Docker Amazon Linux
71
54
runs-on : ubuntu-latest
72
55
needs : auto_update
73
56
steps :
74
57
- uses : actions/checkout@v2
75
58
76
- - name : Restore metadata artifacts
77
- uses : actions/download-artifact@v2
78
- with :
79
- name : metadata-amazonlinux
80
- path : docs/metadata/*amazonlinux*
59
+ - name : Cleanup metadata artifacts
60
+ run : rm -rf docs/metadata/*
81
61
82
62
- name : Build images
83
63
run : make build-amazonlinux
@@ -97,20 +77,18 @@ jobs:
97
77
uses : actions/upload-artifact@v2
98
78
with :
99
79
name : metadata-amazonlinux
100
- path : docs/metadata/*amazonlinux*
80
+ path : docs/metadata
101
81
retention-days : 1
102
82
103
83
docker_centos :
84
+ name : Build Docker CentOS
104
85
runs-on : ubuntu-latest
105
86
needs : auto_update
106
87
steps :
107
88
- uses : actions/checkout@v2
108
89
109
- - name : Restore metadata artifacts
110
- uses : actions/download-artifact@v2
111
- with :
112
- name : metadata-centos
113
- path : docs/metadata/*centos*
90
+ - name : Cleanup metadata artifacts
91
+ run : rm -rf docs/metadata/*
114
92
115
93
- name : Build images
116
94
run : make build-centos
@@ -130,20 +108,18 @@ jobs:
130
108
uses : actions/upload-artifact@v2
131
109
with :
132
110
name : metadata-centos
133
- path : docs/metadata/*centos*
111
+ path : docs/metadata
134
112
retention-days : 1
135
113
136
114
docker_debian :
115
+ name : Build Docker Debian
137
116
runs-on : ubuntu-latest
138
117
needs : auto_update
139
118
steps :
140
119
- uses : actions/checkout@v2
141
120
142
- - name : Restore metadata artifacts
143
- uses : actions/download-artifact@v2
144
- with :
145
- name : metadata-debian
146
- path : docs/metadata/*debian*
121
+ - name : Cleanup metadata artifacts
122
+ run : rm -rf docs/metadata/*
147
123
148
124
- name : Build images
149
125
run : make build-debian
@@ -163,20 +139,18 @@ jobs:
163
139
uses : actions/upload-artifact@v2
164
140
with :
165
141
name : metadata-debian
166
- path : docs/metadata/*debian*
142
+ path : docs/metadata
167
143
retention-days : 1
168
144
169
145
docker_fedora :
146
+ name : Build Docker Fedora
170
147
runs-on : ubuntu-latest
171
148
needs : auto_update
172
149
steps :
173
150
- uses : actions/checkout@v2
174
151
175
- - name : Restore metadata artifacts
176
- uses : actions/download-artifact@v2
177
- with :
178
- name : metadata-fedora
179
- path : docs/metadata/*fedora*
152
+ - name : Cleanup metadata artifacts
153
+ run : rm -rf docs/metadata/*
180
154
181
155
- name : Build images
182
156
run : make build-fedora
@@ -196,20 +170,18 @@ jobs:
196
170
uses : actions/upload-artifact@v2
197
171
with :
198
172
name : metadata-fedora
199
- path : docs/metadata/*fedora*
173
+ path : docs/metadata
200
174
retention-days : 1
201
175
202
176
docker_ubuntu :
177
+ name : Build Docker Ubuntu
203
178
runs-on : ubuntu-latest
204
179
needs : auto_update
205
180
steps :
206
181
- uses : actions/checkout@v2
207
182
208
- - name : Restore metadata artifacts
209
- uses : actions/download-artifact@v2
210
- with :
211
- name : metadata-ubuntu
212
- path : docs/metadata/*ubuntu*
183
+ - name : Cleanup metadata artifacts
184
+ run : rm -rf docs/metadata/*
213
185
214
186
- name : Build images
215
187
run : make build-ubuntu
@@ -229,61 +201,73 @@ jobs:
229
201
uses : actions/upload-artifact@v2
230
202
with :
231
203
name : metadata-ubuntu
232
- path : docs/metadata/*ubuntu*
204
+ path : docs/metadata
233
205
retention-days : 1
234
206
235
207
metadata :
208
+ name : Generates Metadata
236
209
runs-on : ubuntu-latest
237
210
needs : [docker_alpine, docker_amazonlinux, docker_centos, docker_debian, docker_fedora, docker_ubuntu]
238
211
steps :
239
212
- uses : actions/checkout@v2
240
213
241
- - name : Restore alpine metadata artifacts
242
- uses : actions/download-artifact@v2
243
- with :
244
- name : metadata-alpine
245
- path : docs/metadata/*alpine*
246
-
247
214
- name : Restore amazonlinux metadata artifacts
248
215
uses : actions/download-artifact@v2
249
216
with :
250
217
name : metadata-amazonlinux
251
- path : docs/metadata/*amazonlinux*
218
+ path : docs/metadata
252
219
253
220
- name : Restore centos metadata artifacts
254
221
uses : actions/download-artifact@v2
255
222
with :
256
223
name : metadata-centos
257
- path : docs/metadata/*centos*
224
+ path : docs/metadata
258
225
259
226
- name : Restore debian metadata artifacts
260
227
uses : actions/download-artifact@v2
261
228
with :
262
229
name : metadata-debian
263
- path : docs/metadata/*debian*
230
+ path : docs/metadata
264
231
265
232
- name : Restore fedora metadata artifacts
266
233
uses : actions/download-artifact@v2
267
234
with :
268
235
name : metadata-fedora
269
- path : docs/metadata/*fedora*
236
+ path : docs/metadata
270
237
271
238
- name : Restore ubuntu metadata artifacts
272
239
uses : actions/download-artifact@v2
273
240
with :
274
241
name : metadata-ubuntu
275
- path : docs/metadata/*ubuntu*
242
+ path : docs/metadata
276
243
277
244
- name : Push metadata
278
245
run : make auto-commit-metadata
279
246
if : github.ref == 'refs/heads/master'
280
247
281
248
auto_tag :
249
+ name : Create Release
282
250
runs-on : ubuntu-latest
283
251
needs : metadata
284
252
steps :
285
253
- uses : actions/checkout@v2
286
254
287
- - name : Create tag
288
- run : make auto-tag
289
- if : github.ref == 'refs/heads/master'
255
+ - name : Get version
256
+ id : version
257
+ run : echo "::set-output name=version::$(date +'v1.%Y%m%d.%H%M%S')"
258
+
259
+ - name : Test with environment variables
260
+ run : echo $TAG_NAME
261
+ env :
262
+ TAG_NAME : ${{ steps.version.outputs.version }}
263
+
264
+ - name : Create Release
265
+ id : create_release
266
+ uses : actions/create-release@v1
267
+ env :
268
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
269
+ with :
270
+ tag_name : $TAG_NAME
271
+ release_name : Release $TAG_NAME
272
+ draft : false
273
+ prerelease : false
0 commit comments