@@ -10,6 +10,8 @@ name: Release
10
10
" on " :
11
11
release :
12
12
types : [published]
13
+ pull_request :
14
+ branches : [main]
13
15
14
16
jobs :
15
17
docker :
@@ -21,30 +23,44 @@ jobs:
21
23
22
24
steps :
23
25
- uses : actions/checkout@v4
24
- - uses : docker/setup-qemu-action@v2
25
- - uses : docker/setup-buildx-action@v2
26
+ - uses : docker/setup-qemu-action@v3
27
+ - uses : docker/setup-buildx-action@v3
26
28
27
- - uses : docker/login-action@v2
29
+ - uses : docker/login-action@v3
28
30
with :
29
31
username : ${{ secrets.DOCKERHUB_USERNAME }}
30
32
password : ${{ secrets.DOCKERHUB_TOKEN }}
31
33
32
- - uses : docker/login-action@v2
34
+ - uses : docker/login-action@v3
33
35
with :
34
36
registry : ghcr.io
35
37
username : ${{ github.repository_owner }}
36
38
password : ${{ secrets.GITHUB_TOKEN }}
37
39
38
- - uses : docker/metadata-action@v4
40
+ - id : pr-sha
41
+ if : github.event_name == 'pull_request'
42
+ run : echo "sha=$(git rev-parse --short ${{ github.event.pull_request.head.sha }})" >> $GITHUB_OUTPUT
43
+
44
+ - uses : docker/metadata-action@v5
39
45
with :
40
46
images : |
41
47
mccutchen/go-httpbin
42
48
ghcr.io/${{ github.repository }}
49
+ tags : |
50
+ # For releases, use the standard tags and special "latest" tag
51
+ type=semver,pattern={{version}},enable=${{ github.event_name == 'release' }}
52
+ type=semver,pattern={{major}}.{{minor}},enable=${{ github.event_name == 'release' }}
53
+ type=raw,value=latest,enable=${{ github.event_name == 'release' }}
54
+ # For pull requests, use the commit SHA
55
+ type=raw,value=${{ steps.pr-sha.outputs.sha }},enable=${{ github.event_name == 'pull_request' }}
43
56
id : meta
44
57
45
- - uses : docker/build-push-action@v3
58
+ - uses : docker/build-push-action@v6
46
59
with :
47
60
platforms : linux/amd64,linux/arm64
48
61
push : true
62
+ sbom : true
63
+ provenance : mode=max
49
64
tags : ${{ steps.meta.outputs.tags }}
50
65
labels : ${{ steps.meta.outputs.labels }}
66
+ annotations : ${{ steps.meta.outputs.annotations }}
0 commit comments