11name : Gateway Docker
22
33on :
4- workflow_run :
5- workflows :
6- - CI
7- types :
8- - completed
94 push :
105 tags :
116 - " v*"
127 workflow_dispatch :
8+ inputs :
9+ tag :
10+ description : Existing release tag to publish, for example v0.1.0
11+ required : true
1312
1413permissions :
1514 contents : read
1615 packages : write
17- id-token : write
18- attestations : write
1916
2017env :
2118 IMAGE_NAME : ghcr.io/${{ github.repository_owner }}/liveagent-gateway
@@ -24,11 +21,10 @@ jobs:
2421 build-and-push :
2522 name : Build and Push Gateway Image
2623 runs-on : ubuntu-latest
27- if : github.event_name != 'workflow_run' || (github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'main')
2824 steps :
2925 - uses : actions/checkout@v4
3026 with :
31- ref : ${{ github.event.workflow_run.head_sha || github.ref }}
27+ ref : ${{ github.event.inputs.tag || github.ref }}
3228
3329 - uses : docker/setup-qemu-action@v3
3430
@@ -46,13 +42,11 @@ jobs:
4642 uses : docker/metadata-action@v5
4743 with :
4844 images : ${{ env.IMAGE_NAME }}
45+ flavor : |
46+ latest=false
4947 tags : |
50- type=ref,event=branch,enable=${{ github.event_name != 'workflow_run' }}
51- type=ref,event=tag,enable=${{ github.event_name != 'workflow_run' }}
52- type=sha,prefix=sha-,enable=${{ github.event_name != 'workflow_run' }}
53- type=raw,value=main,enable=${{ github.event_name == 'workflow_run' }}
54- type=raw,value=sha-${{ github.event.workflow_run.head_sha }},enable=${{ github.event_name == 'workflow_run' }}
55- type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/v') }}
48+ type=raw,value=${{ github.event.inputs.tag || github.ref_name }}
49+ type=raw,value=latest
5650
5751 - name : Build and push
5852 id : push
6660 labels : ${{ steps.meta.outputs.labels }}
6761 cache-from : type=gha
6862 cache-to : type=gha,mode=max
69-
70- - name : Attest image provenance
71- uses : actions/attest-build-provenance@v2
72- with :
73- subject-name : ${{ env.IMAGE_NAME }}
74- subject-digest : ${{ steps.push.outputs.digest }}
75- push-to-registry : true
63+ provenance : false
0 commit comments