File tree 3 files changed +59
-18
lines changed
3 files changed +59
-18
lines changed Original file line number Diff line number Diff line change
1
+ name : docker
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - ' main'
7
+ tags :
8
+ - ' *.*.*'
9
+ pull_request :
10
+ branches :
11
+ - ' main'
12
+
13
+ jobs :
14
+ docker :
15
+ runs-on : ubuntu-latest
16
+ steps :
17
+ -
18
+ name : Checkout
19
+ uses : actions/checkout@v2
20
+ -
21
+ name : Docker meta
22
+ id : meta
23
+ uses : docker/metadata-action@v3
24
+ with :
25
+ # list of Docker images to use as base name for tags
26
+ images : |
27
+ foomo/pagespeed_exporter
28
+ # generate Docker tags based on the following events/attributes
29
+ tags : |
30
+ type=ref,event=branch
31
+ type=ref,event=pr
32
+ type=semver,pattern={{version}}
33
+ type=semver,pattern={{major}}.{{minor}}
34
+ type=semver,pattern={{major}}
35
+ type=sha
36
+ -
37
+ name : Set up QEMU
38
+ uses : docker/setup-qemu-action@v1
39
+ -
40
+ name : Set up Docker Buildx
41
+ uses : docker/setup-buildx-action@v1
42
+ -
43
+ name : Login to DockerHub
44
+ if : github.event_name != 'pull_request'
45
+ uses : docker/login-action@v1
46
+ with :
47
+ username : ${{ secrets.DOCKERHUB_USERNAME }}
48
+ password : ${{ secrets.DOCKERHUB_TOKEN }}
49
+
50
+ -
51
+ name : Build and push
52
+ uses : docker/build-push-action@v2
53
+ with :
54
+ context : .
55
+ push : ${{ github.event_name != 'pull_request' }}
56
+ tags : ${{ steps.meta.outputs.tags }}
57
+ labels : ${{ steps.meta.outputs.labels }}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -21,7 +21,8 @@ COPY . ./
21
21
FROM base as builder
22
22
MAINTAINER Stefan Martinov <
[email protected] >
23
23
24
- RUN go build -ldflags "-X main.Version=`git rev-parse --short HEAD`" -o /pagespeed_exporter pagespeed_exporter.go
24
+ RUN GOARCH=amd64 GOOS=linux CGO_ENABLED=0 \
25
+ go build -ldflags "-X main.Version=`git rev-parse --short HEAD`" -o /pagespeed_exporter pagespeed_exporter.go
25
26
26
27
# strip and compress the binary
27
28
RUN upx /pagespeed_exporter
You can’t perform that action at this time.
0 commit comments