1- name : Create GitHub release
1+ name : Release
22on :
33 push :
44 tags : ['v*']
55
6+ env :
7+ REGISTRY : ghcr.io
8+ IMAGE_NAME : ${{ github.repository }}
9+ IMAGE_DESCRIPTION : Dev Proxy is an API simulator that helps you effortlessly test your app beyond the happy path.
10+
611jobs :
712 publish_binaries :
813 name : Publish binaries
@@ -145,4 +150,78 @@ jobs:
145150 with :
146151 args : |
147152 output/binaries-*/*.zip
148- output/installer-*/*.exe
153+ output/installer-*/*.exe
154+ deploy_docker :
155+ name : Publish Docker image
156+ runs-on : ubuntu-latest
157+ needs : [create_release]
158+ permissions :
159+ contents : read
160+ packages : write
161+ attestations : write
162+ id-token : write
163+ steps :
164+ - name : Checkout repository
165+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
166+ # Required for multi-platform images
167+ - name : Set up QEMU
168+ uses : docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
169+ # Required for multi-platform images
170+ - name : Set up Docker Buildx
171+ uses : docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
172+ with :
173+ driver-opts : image=moby/buildkit:latest
174+ - name : Log in to the Container registry
175+ uses : docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
176+ with :
177+ registry : ${{ env.REGISTRY }}
178+ username : ${{ github.actor }}
179+ password : ${{ secrets.GITHUB_TOKEN }}
180+ - name : Extract metadata (tags, labels) for Docker
181+ id : meta
182+ uses : docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5.7.0
183+ with :
184+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
185+ flavor : |
186+ latest=false
187+ tags : |
188+ type=semver,pattern={{version}}
189+ type=raw,value=latest,enable=${{ !contains(github.ref_name, '-beta') }}
190+ type=raw,value=beta,enable=${{ contains(github.ref_name, '-beta') }}
191+ labels : |
192+ org.opencontainers.image.description=${{ env.IMAGE_DESCRIPTION }}
193+ annotations : |
194+ org.opencontainers.image.description=${{ env.IMAGE_DESCRIPTION }}
195+ - name : Build and push Docker image
196+ if : " !contains(github.ref_name, '-beta')"
197+ id : push
198+ uses : docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
199+ with :
200+ context : .
201+ push : true
202+ tags : ${{ steps.meta.outputs.tags }}
203+ labels : ${{ steps.meta.outputs.labels }}
204+ annotations : ${{ steps.meta.outputs.annotations }}
205+ platforms : linux/amd64,linux/arm64
206+ build-args : |
207+ DEVPROXY_VERSION=${{ steps.meta.outputs.version }}
208+ - name : Build and push beta Docker image
209+ if : contains(github.ref_name, '-beta')
210+ id : push_beta
211+ uses : docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
212+ with :
213+ context : .
214+ file : ./Dockerfile_beta
215+ push : true
216+ tags : ${{ steps.meta.outputs.tags }}
217+ labels : ${{ steps.meta.outputs.labels }}
218+ annotations : ${{ steps.meta.outputs.annotations }}
219+ platforms : linux/amd64,linux/arm64
220+ build-args : |
221+ DEVPROXY_VERSION=${{ steps.meta.outputs.version }}
222+ - name : Generate artifact attestation
223+ uses : actions/attest-build-provenance@v2
224+ with :
225+ subject-name : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
226+ subject-digest : ${{ steps.push.outputs.digest || steps.push_beta.outputs.digest }}
227+ push-to-registry : true
0 commit comments