29
29
30
30
unit-tests :
31
31
name : Unit Tests
32
- runs-on : ubuntu-18 .04
32
+ runs-on : ubuntu-20 .04
33
33
steps :
34
34
- name : Checkout Repository
35
35
uses : actions/checkout@v2
@@ -42,12 +42,10 @@ jobs:
42
42
43
43
build :
44
44
name : Build Image
45
- runs-on : ubuntu-18 .04
45
+ runs-on : ubuntu-20 .04
46
46
steps :
47
47
- name : Checkout Repository
48
48
uses : actions/checkout@v2
49
- - name : Build Prometheus-Exporter
50
- run : make nginx-prometheus-exporter
51
49
- name : Docker Buildx
52
50
uses : docker/setup-buildx-action@v1
53
51
with :
@@ -59,19 +57,28 @@ jobs:
59
57
key : ${{ runner.os }}-buildx-${{ github.sha }}
60
58
restore-keys : |
61
59
${{ runner.os }}-buildx-
60
+ - name : Run GoReleaser
61
+ uses : goreleaser/goreleaser-action@v2
62
+ with :
63
+ version : latest
64
+ args : --rm-dist --debug --skip-publish --snapshot
65
+ env :
66
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
62
67
- name : Build Image
63
68
uses : docker/build-push-action@v2
64
69
with :
65
70
file : build/Dockerfile
66
71
context : ' .'
72
+ target : local
73
+ platforms : linux/arm,linux/arm64,linux/amd64,linux/ppc64le,linux/s390x
67
74
cache-from : type=local,src=/tmp/.buildx-cache
68
75
cache-to : type=local,dest=/tmp/.buildx-cache
69
76
tags : nginx/nginx-prometheus-exporter:${{ github.sha }}
70
77
push : false
71
78
72
79
release-docker :
73
80
name : Release Image
74
- runs-on : ubuntu-18 .04
81
+ runs-on : ubuntu-20 .04
75
82
needs : [build, unit-tests]
76
83
if :
77
84
github.repository == 'nginxinc/nginx-prometheus-exporter' &&
@@ -99,11 +106,20 @@ jobs:
99
106
with :
100
107
username : ${{ secrets.DOCKER_USERNAME }}
101
108
password : ${{ secrets.DOCKER_PASSWORD }}
109
+ - name : Run GoReleaser
110
+ uses : goreleaser/goreleaser-action@v2
111
+ with :
112
+ version : latest
113
+ args : release --rm-dist
114
+ env :
115
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
102
116
- name : Push to Dockerhub
103
117
uses : docker/build-push-action@v2
104
118
with :
105
119
file : build/Dockerfile
106
120
context : ' .'
121
+ target : local
122
+ platforms : linux/arm,linux/arm64,linux/amd64,linux/ppc64le,linux/s390x
107
123
tags : |
108
124
nginx/nginx-prometheus-exporter:latest
109
125
nginx/nginx-prometheus-exporter:${{ steps.get_version.outputs.GIT_TAG }}
@@ -117,17 +133,10 @@ jobs:
117
133
publish : true
118
134
env :
119
135
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
120
- - name : Run GoReleaser
121
- uses : goreleaser/goreleaser-action@v2
122
- with :
123
- version : latest
124
- args : release --rm-dist
125
- env :
126
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
127
136
128
137
notify :
129
138
name : Notify
130
- runs-on : ubuntu-18 .04
139
+ runs-on : ubuntu-20 .04
131
140
needs : release-docker
132
141
if : always() && github.ref == 'refs/heads/master'
133
142
steps :
0 commit comments