Skip to content

Commit d483466

Browse files
jcrapuchettesclaude
andcommitted
Use Docker Metadata Action for automatic lowercase conversion
Replace manual tag generation with docker/metadata-action which: - Automatically converts repository names to lowercase for GHCR - Generates proper OCI-compliant labels - Provides better tag management This fixes the "repository name must be lowercase" error. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 4450ca4 commit d483466

File tree

2 files changed

+23
-6
lines changed

2 files changed

+23
-6
lines changed

.github/workflows/ci.yaml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,27 @@ jobs:
3939
username: ${{ github.actor }}
4040
password: ${{ secrets.GITHUB_TOKEN }}
4141

42+
- name: Extract metadata
43+
id: meta
44+
uses: docker/metadata-action@v5
45+
with:
46+
images: ghcr.io/${{ github.repository }}
47+
tags: |
48+
type=raw,value=${{ matrix.pg_version.major }}
49+
type=raw,value=${{ matrix.pg_version.full }}
50+
type=raw,value=${{ steps.tag.outputs.TAG }}-${{ matrix.pg_version.major }}
51+
4252
- name: Build and push release
4353
uses: docker/build-push-action@v6
4454
with:
4555
context: .
4656
file: ./pg${{ matrix.pg_version.major }}/Dockerfile
4757
push: true
48-
tags: |
49-
ghcr.io/${{ github.repository }}:${{ matrix.pg_version.major }}
50-
ghcr.io/${{ github.repository }}:${{ matrix.pg_version.full }}
51-
ghcr.io/${{ github.repository }}:${{ steps.tag.outputs.TAG }}-${{ matrix.pg_version.major }}
58+
tags: ${{ steps.meta.outputs.tags }}
59+
labels: ${{ steps.meta.outputs.labels }}
5260
build-args: |
5361
PG_VERSION=${{ matrix.pg_version.full }}
54-
PG_MAJOR_VERSION=${{ matrix.pg_version.full }}
62+
PG_MAJOR_VERSION=${{ matrix.pg_version.major }}
5563
VERSION=${{ steps.tag.outputs.TAG }}
5664
cache-from: type=gha
5765
cache-to: type=gha,mode=max

.github/workflows/push.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,22 @@ jobs:
105105
username: ${{ github.actor }}
106106
password: ${{ secrets.GITHUB_TOKEN }}
107107

108+
- name: Extract metadata
109+
id: meta
110+
uses: docker/metadata-action@v5
111+
with:
112+
images: ghcr.io/${{ github.repository }}
113+
tags: |
114+
type=raw,value=${{ matrix.pg_version.major }}-latest
115+
108116
- name: Build and push latest
109117
uses: docker/build-push-action@v6
110118
with:
111119
context: .
112120
file: ./pg${{ matrix.pg_version.major }}/Dockerfile
113121
push: true
114-
tags: ghcr.io/${{ github.repository }}:${{ matrix.pg_version.major }}-latest
122+
tags: ${{ steps.meta.outputs.tags }}
123+
labels: ${{ steps.meta.outputs.labels }}
115124
build-args: |
116125
PG_VERSION=${{ matrix.pg_version.full }}
117126
PG_MAJOR_VERSION=${{ matrix.pg_version.major }}

0 commit comments

Comments
 (0)