Skip to content

Commit 65745ba

Browse files
committed
bunch of updates
1 parent 0a05ada commit 65745ba

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

.github/workflows/release.yaml

+22-6
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ name: Release
1010
"on":
1111
release:
1212
types: [published]
13+
pull_request:
14+
branches: [main]
1315

1416
jobs:
1517
docker:
@@ -21,30 +23,44 @@ jobs:
2123

2224
steps:
2325
- 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
2628

27-
- uses: docker/login-action@v2
29+
- uses: docker/login-action@v3
2830
with:
2931
username: ${{ secrets.DOCKERHUB_USERNAME }}
3032
password: ${{ secrets.DOCKERHUB_TOKEN }}
3133

32-
- uses: docker/login-action@v2
34+
- uses: docker/login-action@v3
3335
with:
3436
registry: ghcr.io
3537
username: ${{ github.repository_owner }}
3638
password: ${{ secrets.GITHUB_TOKEN }}
3739

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
3945
with:
4046
images: |
4147
mccutchen/go-httpbin
4248
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' }}
4356
id: meta
4457

45-
- uses: docker/build-push-action@v3
58+
- uses: docker/build-push-action@v6
4659
with:
4760
platforms: linux/amd64,linux/arm64
4861
push: true
62+
sbom: true
63+
provenance: mode=max
4964
tags: ${{ steps.meta.outputs.tags }}
5065
labels: ${{ steps.meta.outputs.labels }}
66+
annotations: ${{ steps.meta.outputs.annotations }}

0 commit comments

Comments
 (0)