Skip to content

Commit d0da518

Browse files
committed
ci: add github actions
1 parent 05ff334 commit d0da518

File tree

3 files changed

+60
-1
lines changed

3 files changed

+60
-1
lines changed

.github/dependabot.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: github-actions
9+
directory: /
10+
labels:
11+
- dependabot
12+
- actions
13+
schedule:
14+
interval: daily
15+
16+
- package-ecosystem: "gomod" # See documentation for possible values
17+
directory: "/" # Location of package manifests
18+
schedule:
19+
interval: "daily"

.github/workflows/realease.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
on:
2+
push:
3+
tags:
4+
- v*
5+
6+
jobs:
7+
releases-matrix:
8+
name: Release Go Binary
9+
runs-on: ubuntu-latest
10+
strategy:
11+
max-parallel: 1
12+
matrix:
13+
include:
14+
- goarch: amd64
15+
goos: darwin
16+
- goarch: arm64
17+
goos: darwin
18+
- goarch: amd64
19+
goos: linux
20+
- goarch: arm64
21+
goos: linux
22+
- goarch: amd64
23+
goos: windows
24+
steps:
25+
- name: Show environment
26+
run: export
27+
- uses: actions/checkout@v3
28+
- uses: ncipollo/release-action@v1
29+
with:
30+
allowUpdates: true
31+
token: ${{ secrets.GITHUB_TOKEN }}
32+
- uses: wangyoucao577/go-release-action@master
33+
with:
34+
github_token: ${{ secrets.GITHUB_TOKEN }}
35+
goos: ${{ matrix.goos }}
36+
goarch: ${{ matrix.goarch }}
37+
build_command: "make"
38+
binary_name: "pingexporter"
39+
extra_files: pingexporter
40+

main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func main() {
3030
cfg.Verify()
3131
ping := metrics.New(cfg)
3232
prometheus.MustRegister(ping)
33-
http.Handle("/metrics", promhttp.Handler())
33+
http.Handle(cfg.Web.MetricsPath, promhttp.Handler())
3434

3535
log.Info().Str("address", cfg.Web.Address).Msg("starting web server")
3636
if err := http.ListenAndServe(cfg.Web.Address, nil); err != nil {

0 commit comments

Comments
 (0)