Skip to content

Commit ae8a6ed

Browse files
authored
ci: push to ghcr.io (again) (#201)
1 parent 37e9998 commit ae8a6ed

File tree

1 file changed

+34
-7
lines changed

1 file changed

+34
-7
lines changed

.github/workflows/release.yaml

+34-7
Original file line numberDiff line numberDiff line change
@@ -5,41 +5,68 @@
55
# - https://github.com/docker/build-push-action/#usage
66
# - https://docs.github.com/en/actions/publishing-packages/publishing-docker-images
77

8-
name: Release
8+
name: release
99

1010
"on":
1111
release:
1212
types: [published]
1313

14+
# we do not build and push images for every commit, only for tagged releases.
15+
# uncomment this to enablle building for pull requests, to debug this
16+
# workflow.
17+
#
18+
# pull_request:
19+
# branches: [main]
20+
1421
jobs:
1522
docker:
1623
runs-on: ubuntu-latest
24+
25+
permissions:
26+
contents: read
27+
packages: write
28+
1729
steps:
1830
- uses: actions/checkout@v4
19-
- uses: docker/setup-qemu-action@v2
20-
- uses: docker/setup-buildx-action@v2
31+
- uses: docker/setup-qemu-action@v3
32+
- uses: docker/setup-buildx-action@v3
2133

22-
- uses: docker/login-action@v2
34+
- uses: docker/login-action@v3
2335
with:
2436
username: ${{ secrets.DOCKERHUB_USERNAME }}
2537
password: ${{ secrets.DOCKERHUB_TOKEN }}
2638

27-
- uses: docker/login-action@v2
39+
- uses: docker/login-action@v3
2840
with:
2941
registry: ghcr.io
3042
username: ${{ github.repository_owner }}
3143
password: ${{ secrets.GITHUB_TOKEN }}
3244

33-
- uses: docker/metadata-action@v4
45+
- uses: docker/metadata-action@v5
3446
with:
3547
images: |
3648
mccutchen/go-httpbin
3749
ghcr.io/${{ github.repository }}
50+
tags: |
51+
# For releases, use the standard tags and special "latest" tag
52+
type=semver,pattern={{version}},enable=${{ github.event_name == 'release' }}
53+
type=semver,pattern={{major}}.{{minor}},enable=${{ github.event_name == 'release' }}
54+
type=raw,value=latest,enable=${{ github.event_name == 'release' }}
55+
56+
# For pull requests, use the commit SHA
57+
#
58+
# Note that this is disabled by default, but can be enabled for
59+
# debugging purposes by uncommenting the pull_request trigger at
60+
# top of the workflow.
61+
type=sha,format=short,enable=${{ github.event_name == 'pull_request' }}
3862
id: meta
3963

40-
- uses: docker/build-push-action@v3
64+
- uses: docker/build-push-action@v6
4165
with:
4266
platforms: linux/amd64,linux/arm64
4367
push: true
68+
sbom: true
69+
provenance: mode=max
4470
tags: ${{ steps.meta.outputs.tags }}
4571
labels: ${{ steps.meta.outputs.labels }}
72+
annotations: ${{ steps.meta.outputs.annotations }}

0 commit comments

Comments
 (0)