33 # Sequence of patterns matched against refs/tags
44 tags :
55 - ' v*' # Push events to matching v*, i.e. v1.0, v20.15.10
6+ branches :
7+ - dev
68
79name : Latest Release
810
1820 - uses : actions/checkout@v4
1921 - uses : actions/setup-go@v4
2022 with :
21- go-version : ' 1.21.6 '
23+ go-version : ' 1.23 '
2224 - name : golangci-lint
23252426 with :
2830 contents : write
2931 name : Create Release
3032 runs-on : ' ubuntu-latest'
33+ if : startsWith(github.ref, 'refs/tags/v')
3134 strategy :
3235 matrix :
3336 # List of GOOS and GOARCH pairs from `go tool dist list`
4144 fetch-depth : 0
4245 - uses : actions/setup-go@v4
4346 with :
44- go-version : ' 1.21.6 '
47+ go-version : ' 1.23 '
4548 - name : Get OS and arch info
4649 run : |
4750 GOOSARCH=${{matrix.goosarch}}
@@ -66,12 +69,12 @@ jobs:
6669 build :
6770 name : Build/publish container image
6871 runs-on : ubuntu-latest
72+ if : startsWith(github.ref, 'refs/tags/v') # only build latest from tagged versions
73+ needs : release
6974 permissions :
7075 contents : read
7176 packages : write
7277 id-token : write
73- if : " !contains(github.ref, 'dev')" # skip building container for dev
74- needs : release
7578
7679 steps :
7780 - name : Checkout repository
@@ -106,3 +109,41 @@ jobs:
106109 cache-from : type=gha
107110 cache-to : type=gha,mode=max
108111 platforms : linux/amd64,linux/386
112+
113+ build-dev :
114+ name : Build/publish dev image
115+ runs-on : ubuntu-latest
116+ if : github.ref == 'refs/heads/dev'
117+ permissions :
118+ contents : read
119+ packages : write
120+ id-token : write
121+
122+ steps :
123+ - name : Checkout repository
124+ uses : actions/checkout@v4
125+ with :
126+ fetch-depth : 0
127+
128+ - name : Login to ghcr.io
129+ uses : docker/login-action@v2
130+ with :
131+ registry : ghcr.io
132+ username : ${{ github.actor }}
133+ password : ${{ secrets.GITHUB_TOKEN }}
134+
135+ - name : Convert repository name to lowercase
136+ run : echo "REPO_LC=$(echo '${{ github.repository }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
137+
138+ - name : Set up Docker Buildx
139+ uses : docker/setup-buildx-action@v2
140+
141+ - name : Build and push dev image
142+ uses : docker/build-push-action@v5
143+ with :
144+ context : .
145+ push : true
146+ tags : ghcr.io/${{ env.REPO_LC }}:dev
147+ cache-from : type=gha
148+ cache-to : type=gha,mode=max
149+ platforms : linux/amd64,linux/386
0 commit comments