File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313
1414permissions :
1515 contents : write
16+ packages : write
1617
1718jobs :
1819 test :
@@ -140,3 +141,53 @@ jobs:
140141 body : ${{ steps.notes.outputs.notes }}
141142 files : dist/*
142143 generate_release_notes : false
144+
145+ docker-image :
146+ name : Docker image
147+ needs : test
148+ runs-on : ubuntu-latest
149+ steps :
150+ - name : Resolve tag
151+ id : tag
152+ run : |
153+ if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
154+ echo "version=${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT
155+ else
156+ echo "version=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT
157+ fi
158+
159+ - uses : actions/checkout@v4
160+ with :
161+ ref : ${{ steps.tag.outputs.version }}
162+
163+ - uses : docker/setup-buildx-action@v3
164+
165+ - name : Log in to GHCR
166+ uses : docker/login-action@v3
167+ with :
168+ registry : ghcr.io
169+ username : ${{ github.actor }}
170+ password : ${{ secrets.GITHUB_TOKEN }}
171+
172+ - name : Extract metadata
173+ id : meta
174+ uses : docker/metadata-action@v5
175+ with :
176+ images : ghcr.io/${{ github.repository }}
177+ tags : |
178+ type=semver,pattern={{version}}
179+ type=semver,pattern={{major}}.{{minor}}
180+ type=raw,value=latest
181+
182+ - name : Build and push
183+ uses : docker/build-push-action@v6
184+ with :
185+ context : .
186+ push : true
187+ platforms : linux/amd64,linux/arm64
188+ tags : ${{ steps.meta.outputs.tags }}
189+ labels : ${{ steps.meta.outputs.labels }}
190+ build-args : |
191+ VERSION=${{ steps.tag.outputs.version }}
192+ cache-from : type=gha
193+ cache-to : type=gha,mode=max
Original file line number Diff line number Diff line change 1- FROM golang:1.23 -alpine AS builder
1+ FROM golang:1.25 -alpine AS builder
22
33WORKDIR /app
44
You can’t perform that action at this time.
0 commit comments