2929
3030 unit-tests :
3131 name : Unit Tests
32- runs-on : ubuntu-18 .04
32+ runs-on : ubuntu-20 .04
3333 steps :
3434 - name : Checkout Repository
3535 uses : actions/checkout@v2
@@ -42,12 +42,10 @@ jobs:
4242
4343 build :
4444 name : Build Image
45- runs-on : ubuntu-18 .04
45+ runs-on : ubuntu-20 .04
4646 steps :
4747 - name : Checkout Repository
4848 uses : actions/checkout@v2
49- - name : Build Prometheus-Exporter
50- run : make nginx-prometheus-exporter
5149 - name : Docker Buildx
5250 uses : docker/setup-buildx-action@v1
5351 with :
@@ -59,19 +57,28 @@ jobs:
5957 key : ${{ runner.os }}-buildx-${{ github.sha }}
6058 restore-keys : |
6159 ${{ 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 }}
6267 - name : Build Image
6368 uses : docker/build-push-action@v2
6469 with :
6570 file : build/Dockerfile
6671 context : ' .'
72+ target : local
73+ platforms : linux/arm,linux/arm64,linux/amd64,linux/ppc64le,linux/s390x
6774 cache-from : type=local,src=/tmp/.buildx-cache
6875 cache-to : type=local,dest=/tmp/.buildx-cache
6976 tags : nginx/nginx-prometheus-exporter:${{ github.sha }}
7077 push : false
7178
7279 release-docker :
7380 name : Release Image
74- runs-on : ubuntu-18 .04
81+ runs-on : ubuntu-20 .04
7582 needs : [build, unit-tests]
7683 if :
7784 github.repository == 'nginxinc/nginx-prometheus-exporter' &&
@@ -99,11 +106,20 @@ jobs:
99106 with :
100107 username : ${{ secrets.DOCKER_USERNAME }}
101108 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 }}
102116 - name : Push to Dockerhub
103117 uses : docker/build-push-action@v2
104118 with :
105119 file : build/Dockerfile
106120 context : ' .'
121+ target : local
122+ platforms : linux/arm,linux/arm64,linux/amd64,linux/ppc64le,linux/s390x
107123 tags : |
108124 nginx/nginx-prometheus-exporter:latest
109125 nginx/nginx-prometheus-exporter:${{ steps.get_version.outputs.GIT_TAG }}
@@ -117,17 +133,10 @@ jobs:
117133 publish : true
118134 env :
119135 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 }}
127136
128137 notify :
129138 name : Notify
130- runs-on : ubuntu-18 .04
139+ runs-on : ubuntu-20 .04
131140 needs : release-docker
132141 if : always() && github.ref == 'refs/heads/master'
133142 steps :
0 commit comments