Skip to content

Commit cc9ce5b

Browse files
committed
chore: update Docker workflow for improved readability and consistency
1 parent f3b3390 commit cc9ce5b

File tree

1 file changed

+25
-10
lines changed

1 file changed

+25
-10
lines changed

.github/workflows/docker-publish-multi-platform.yml

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ name: Multi-Platform Docker Build
22

33
on:
44
push:
5-
tags: [ 'v*.*.*' ]
5+
tags:
6+
- 'v*.*.*'
67

78
env:
89
REGISTRY: ghcr.io
@@ -14,24 +15,31 @@ jobs:
1415
permissions:
1516
contents: read
1617
packages: write
18+
id-token: write
19+
20+
strategy:
21+
matrix:
22+
platform:
23+
- linux/amd64
24+
- linux/arm64
1725

1826
steps:
1927
- name: Checkout repository
20-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
28+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #5
2129

2230
- name: Set up Docker Buildx
23-
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3
31+
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 #3.11.1
2432

2533
- name: Log in to the Container registry
26-
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3
34+
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 #3.5.0
2735
with:
2836
registry: ${{ env.REGISTRY }}
2937
username: ${{ github.actor }}
3038
password: ${{ secrets.GITHUB_TOKEN }}
3139

3240
- name: Extract metadata (tags, labels) for Docker
3341
id: meta
34-
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5
42+
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f #5.8.0
3543
with:
3644
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
3745
tags: |
@@ -42,12 +50,19 @@ jobs:
4250
type=sha
4351
4452
- name: Build and push Docker image
45-
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5
53+
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 #6.18.0
4654
with:
4755
context: .
48-
platforms: linux/amd64,linux/arm64
56+
platforms: ${{ matrix.platform }}
4957
push: true
5058
tags: ${{ steps.meta.outputs.tags }}
51-
labels: ${{ steps.meta.outputs.labels }}
52-
cache-from: type=gha
53-
cache-to: type=gha,mode=max
59+
labels: |
60+
${{ steps.meta.outputs.labels }}
61+
org.opencontainers.image.revision=${{ github.sha }}
62+
org.opencontainers.image.created=${{ github.event.head_commit.timestamp }}
63+
cache-from: |
64+
type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:cache
65+
type=gha
66+
cache-to: |
67+
type=gha,mode=max
68+
type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:cache,mode=max

0 commit comments

Comments
 (0)