File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : ci
2+
3+ on :
4+ push :
5+ branches : ['main']
6+ release :
7+ types :
8+ - created
9+ env :
10+ REGISTRY : ghcr.io
11+ IMAGE_NAME : ${{ github.repository }}
12+
13+ jobs :
14+ golangci :
15+ name : lint
16+ runs-on : ubuntu-latest
17+ steps :
18+ - name : Checkout repository
19+ uses : actions/checkout@v2
20+
21+ - name : Run golangci-lint
22+ uses : golangci/golangci-lint-action@v2
23+
24+ build-and-push-image :
25+ runs-on : ubuntu-latest
26+ permissions :
27+ contents : read
28+ packages : write
29+
30+ steps :
31+ - name : Checkout repository
32+ uses : actions/checkout@v2
33+
34+ - name : Set up QEMU
35+ uses : docker/setup-qemu-action@v1
36+
37+ - name : Set up Docker Buildx
38+ uses : docker/setup-buildx-action@v1
39+
40+ - name : Log in to the Container registry
41+ uses : docker/login-action@v1
42+ with :
43+ registry : ${{ env.REGISTRY }}
44+ username : ${{ github.actor }}
45+ password : ${{ secrets.GITHUB_TOKEN }}
46+
47+ - name : Extract metadata (tags, labels) for Docker
48+ id : meta
49+ uses : docker/metadata-action@v3
50+ with :
51+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
52+
53+ - name : Build and push Docker image
54+ uses : docker/build-push-action@v2
55+ with :
56+ context : .
57+ push : true
58+ tags : ${{ steps.meta.outputs.tags }}
59+ labels : ${{ steps.meta.outputs.labels }}
Original file line number Diff line number Diff line change 1+ # Binaries for programs and plugins
2+ * .exe
3+ * .exe~
4+ * .dll
5+ * .so
6+ * .dylib
7+
8+ # Test binary, built with `go test -c`
9+ * .test
10+
11+ # Output of the go coverage tool, specifically when used with LiteIDE
12+ * .out
13+
14+ # Dependency directories (remove the comment below to include it)
15+ # vendor/
16+ #
17+
18+ # Binary
19+ netcupscp-exporter
Original file line number Diff line number Diff line change 1+ FROM golang:1.17.6-alpine3.15 AS builder
2+ WORKDIR /go/src/github.com/mrueg/netcupscp-exporter
3+ COPY . .
4+ RUN apk --no-cache add make git && make
5+
6+ FROM scratch
7+ COPY --from=builder /go/src/github.com/mrueg/netcupscp-exporter/netcupscp-exporter /
8+
9+ CMD ["/netcupscp-exporter" ]
You can’t perform that action at this time.
0 commit comments