Skip to content

Commit e3190c0

Browse files
ci(docker): simplify publish to match working repo pattern
Revert the over-engineered linking attempts (provenance: false, index annotations, dispatch tag input, Dockerfile source LABEL). Our working repos (e.g. offendingcommit/infra) link GHCR packages with the plain metadata-action labels + GITHUB_TOKEN push — none of the extras helped or were needed. Match that. Package<->repo linking is handled by the one-time Connect Repository step in package settings. Type ci → no version bump.
1 parent 3a22f8e commit e3190c0

2 files changed

Lines changed: 2 additions & 33 deletions

File tree

.github/workflows/docker-publish.yml

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@ on:
44
release:
55
types: [published]
66
workflow_dispatch:
7-
inputs:
8-
tag:
9-
description: Existing tag to (re)build and publish, e.g. v0.13.0. Defaults to the triggering ref.
10-
required: false
11-
type: string
127

138
permissions:
149
contents: read
@@ -20,18 +15,6 @@ jobs:
2015
runs-on: ubuntu-latest
2116
steps:
2217
- uses: actions/checkout@v4
23-
with:
24-
ref: ${{ github.event.inputs.tag || github.ref }}
25-
26-
# Derive the image version from the tag (release ref or dispatch input) so
27-
# raw tags work for both triggers — semver-from-ref doesn't fire on dispatch.
28-
- id: ver
29-
shell: bash
30-
run: |
31-
REF="${{ github.event.inputs.tag || github.ref_name }}"
32-
V="${REF#v}"
33-
echo "version=$V" >> "$GITHUB_OUTPUT"
34-
echo "minor=${V%.*}" >> "$GITHUB_OUTPUT"
3518

3619
- uses: docker/setup-qemu-action@v3
3720
- uses: docker/setup-buildx-action@v3
@@ -44,15 +27,11 @@ jobs:
4427

4528
- id: meta
4629
uses: docker/metadata-action@v5
47-
# Annotate the INDEX (not just per-platform configs) so GHCR can read
48-
# org.opencontainers.image.source and auto-link the package to the repo.
49-
env:
50-
DOCKER_METADATA_ANNOTATIONS_LEVELS: index
5130
with:
5231
images: ghcr.io/${{ github.repository_owner }}/openconcho-web
5332
tags: |
54-
type=raw,value=${{ steps.ver.outputs.version }}
55-
type=raw,value=${{ steps.ver.outputs.minor }}
33+
type=semver,pattern={{version}}
34+
type=semver,pattern={{major}}.{{minor}}
5635
type=raw,value=latest
5736
type=sha,format=short
5837
@@ -61,11 +40,7 @@ jobs:
6140
context: .
6241
platforms: linux/amd64,linux/arm64
6342
push: true
64-
# provenance off keeps the pushed artifact a plain multi-arch index,
65-
# so the index annotation below is what GHCR sees for repo linking.
66-
provenance: false
6743
tags: ${{ steps.meta.outputs.tags }}
6844
labels: ${{ steps.meta.outputs.labels }}
69-
annotations: ${{ steps.meta.outputs.annotations }}
7045
cache-from: type=gha
7146
cache-to: type=gha,mode=max

Dockerfile

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,6 @@ RUN pnpm --filter @openconcho/web build
3030
# under a read-only filesystem with cap_drop ALL.
3131
FROM nginxinc/nginx-unprivileged:alpine
3232

33-
# Baked into the image config — the canonical, build-tool-independent signal GHCR
34-
# reads to connect the published package to this repo. Evaluated at package
35-
# creation, so it links freshly-created packages without relying on buildx
36-
# annotation levels.
37-
LABEL org.opencontainers.image.source="https://github.com/offendingcommit/openconcho"
38-
3933
COPY --chown=101:101 --from=builder /app/packages/web/dist /usr/share/nginx/html
4034
# Rendered to /etc/nginx/conf.d/default.conf by the image's envsubst entrypoint.
4135
COPY --chown=101:101 docker/nginx.conf.template /etc/nginx/templates/default.conf.template

0 commit comments

Comments
 (0)