File tree Expand file tree Collapse file tree 4 files changed +86
-2
lines changed Expand file tree Collapse file tree 4 files changed +86
-2
lines changed Original file line number Diff line number Diff line change
1
+ name : Tag Docker image
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - ' master'
7
+ tags :
8
+ - ' v*'
9
+
10
+ env :
11
+ REGISTRY : ghcr.io
12
+ IMAGE_NAME : ${{ github.repository }}
13
+
14
+ jobs :
15
+ build :
16
+ runs-on : ubuntu-latest
17
+ steps :
18
+ - name : Checkout
19
+ uses : actions/checkout@v2
20
+
21
+ - name : Log into the Container registry
22
+ uses : docker/login-action@v3
23
+ with :
24
+ registry : ${{ env.REGISTRY }}
25
+ username : ${{ github.actor }}
26
+ password : ${{ secrets.GITHUB_TOKEN }}
27
+
28
+ - name : Extract metadata for the Docker image
29
+ id : meta
30
+ uses : docker/metadata-action@v4
31
+ with :
32
+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
33
+
34
+ - name : Set up Docker Buildx
35
+ uses : docker/setup-buildx-action@v3
36
+
37
+ - name : Build and push the Docker image
38
+ uses : docker/build-push-action@v4
39
+ with :
40
+ context : .
41
+ push : true
42
+ tags : ${{ steps.meta.outputs.tags }}
43
+ labels : ${{ steps.meta.outputs.labels }}
44
+ platforms : linux/amd64,linux/arm64
Original file line number Diff line number Diff line change
1
+ name : Pull Request
2
+
3
+ on :
4
+ pull_request :
5
+
6
+ jobs :
7
+ build :
8
+ runs-on : ubuntu-latest
9
+ strategy :
10
+ matrix :
11
+ arch : [ linux/amd64, linux/arm64 ]
12
+ steps :
13
+ - name : Check out code
14
+ uses : actions/checkout@v4
15
+ - name : Setup Go
16
+ uses : actions/setup-go@v5
17
+ with :
18
+ go-version : ' >=1.21.0'
19
+ - name : Set up Docker Buildx
20
+ uses : docker/setup-buildx-action@v3
21
+ - name : Go Format
22
+ run : make fmt && git diff --exit-code
23
+ - name : Go Vet
24
+ run : make vet
25
+ - name : Go Tidy
26
+ run : go mod tidy && git diff --exit-code
27
+ - name : Go Mod
28
+ run : go mod download
29
+ - name : Go Mod Verify
30
+ run : go mod verify
31
+ - name : Go Test
32
+ run : make test
33
+ - name : Build Docker
34
+ uses : docker/build-push-action@v5
35
+ with :
36
+ push : false
Original file line number Diff line number Diff line change @@ -26,11 +26,15 @@ integration:
26
26
RUN_INTEGRATION_TESTS=true go test -v ./...
27
27
.PHONY : integration
28
28
29
+ vet :
30
+ go vet ./...
31
+ .PHONY : vet
32
+
29
33
fmt :
30
34
gofmt -s -w .
31
35
.PHONY : fmt
32
36
33
- check : fmt clean build build-docker lint test integration
37
+ check : fmt vet clean build build-docker lint test integration
34
38
.PHONY : check
35
39
36
40
lint :
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ require (
9
9
github.com/go-chi/chi/v5 v5.0.12
10
10
github.com/minio/minio-go/v7 v7.0.66
11
11
github.com/prometheus/client_golang v1.19.0
12
+ github.com/rs/zerolog v1.32.0
12
13
github.com/stretchr/testify v1.9.0
13
14
github.com/urfave/cli/v2 v2.27.1
14
15
)
@@ -77,7 +78,6 @@ require (
77
78
github.com/rivo/uniseg v0.4.3 // indirect
78
79
github.com/rogpeppe/go-internal v1.11.0 // indirect
79
80
github.com/rs/xid v1.5.0 // indirect
80
- github.com/rs/zerolog v1.32.0 // indirect
81
81
github.com/russross/blackfriday/v2 v2.1.0 // indirect
82
82
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
83
83
github.com/sirupsen/logrus v1.9.3 // indirect
You can’t perform that action at this time.
0 commit comments