File tree Expand file tree Collapse file tree 1 file changed +51
-0
lines changed Expand file tree Collapse file tree 1 file changed +51
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : CI (main and tags)
2
+ on :
3
+ push :
4
+ branches : [ "main", "gh-actions" ]
5
+ tags : [ "v*" ]
6
+ permissions :
7
+ checks : write
8
+ contents : write
9
+ packages : write
10
+ pull-requests : read
11
+ jobs :
12
+ lint-test :
13
+ name : Lint
14
+ runs-on : ubuntu-latest
15
+ if : ${{ !startsWith(github.ref, 'refs/tags/') }}
16
+ steps :
17
+ - uses : actions/checkout@v4
18
+ - uses : actions/setup-go@v5
19
+ - name : lint
20
+ uses : golangci/golangci-lint-action@v6
21
+ with :
22
+ version : latest
23
+
24
+ build-publish :
25
+ name : Build and Publish
26
+ runs-on : ubuntu-latest
27
+ steps :
28
+ - name : Set up Docker Buildx
29
+ uses : docker/setup-buildx-action@v1
30
+ - name : Login to ghcr.io
31
+ uses : docker/login-action@v3
32
+ with :
33
+ registry : ghcr.io
34
+ username : ${{ github.actor }}
35
+ password : ${{ secrets.GITHUB_TOKEN }}
36
+ - name : Extract metadata (tags, labels) for Docker
37
+ id : meta
38
+ uses : docker/metadata-action@v5
39
+ with :
40
+ images : |
41
+ ghcr.io/${{ github.repository }}
42
+ tags : |
43
+ type=raw,value=latest,enable=${{ github.ref_name == 'gh-actions' }}
44
+ type=semver,pattern={{raw}}
45
+ - name : Build and push
46
+ uses : docker/build-push-action@v6
47
+ with :
48
+ platforms : linux/amd64,linux/arm64
49
+ push : true
50
+ tags : ${{ steps.meta.outputs.tags }}
51
+ labels : ${{ steps.meta.outputs.labels }}
You can’t perform that action at this time.
0 commit comments