Skip to content

Commit ddb7263

Browse files
committed
github: release docker image with goreleaser
1 parent d0b0095 commit ddb7263

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

.github/workflows/release.yaml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,16 @@ on:
88
jobs:
99
release:
1010
runs-on: ubuntu-latest
11-
environment: release
1211
steps:
1312
- uses: actions/checkout@v4
1413
- uses: actions/setup-go@v5
1514
with:
1615
go-version: stable
16+
- uses: docker/setup-buildx-action@v3
17+
- uses: docker/login-action@v3
18+
with:
19+
username: ${{ secrets.DOCKERHUB_USERNAME }}
20+
password: ${{ secrets.DOCKERHUB_TOKEN }}
1721
- uses: goreleaser/goreleaser-action@v6
1822
with:
1923
args: release --clean
@@ -22,12 +26,3 @@ jobs:
2226
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2327
BUILD_BRANCH: ${{ vars.BUILD_BRANCH }}
2428
BUILD_USER: ${{ vars.BUILD_USER }}
25-
- uses: docker/setup-buildx-action@v3
26-
- uses: docker/login-action@v3
27-
with:
28-
username: ${{ secrets.DOCKERHUB_USERNAME }}
29-
password: ${{ secrets.DOCKERHUB_TOKEN }}
30-
- uses: docker/build-push-action@v6
31-
with:
32-
push: true
33-
tags: theo01/prometheus-dummy-exporter:latest

.github/workflows/test.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: test
22

3-
on: push
3+
on:
4+
push:
5+
tags-ignore:
6+
- v*
47

58
jobs:
69
test:

.goreleaser.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ archives:
3535
- goos: windows
3636
format: zip
3737

38+
dockers:
39+
- image_templates:
40+
- theo01/prometheus-dummy-exporter
41+
extra_files:
42+
- example/simple.yml
43+
3844
changelog:
3945
sort: asc
4046
filters:

0 commit comments

Comments
 (0)