Skip to content

Commit 04a2989

Browse files
committed
build: move image labels to pipeline
1 parent 44355b2 commit 04a2989

File tree

2 files changed

+9
-15
lines changed

2 files changed

+9
-15
lines changed

.github/workflows/release.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,15 @@ jobs:
100100
sbom: true
101101
build-args: |
102102
VERSION=${{ github.ref_name }}
103-
REVISION=${{ github.sha }}
104-
BUILD_DATE=${{ github.event.head_commit.timestamp }}
103+
labels: |
104+
org.opencontainers.image.title "${{ github.event.repository.name }}"
105+
org.opencontainers.image.description "${{ github.event.repository.description }}"
106+
org.opencontainers.image.source "${{ github.event.repository.html_url }}"
107+
org.opencontainers.image.url "ghcr.io/boxboxjason/gitlab-sync"
108+
org.opencontainers.image.created "${{ github.event }}"
109+
org.opencontainers.image.revision "${{ github.sha }}"
110+
org.opencontainers.image.version "${{ github.ref_name }}"
111+
org.opencontainers.image.vendor "${{ github.repository_owner}}"
105112
tags: |
106113
ghcr.io/${{ env.REPO_NAME }}:${{ github.ref_name }}
107114
ghcr.io/${{ env.REPO_NAME }}:${{ env.MAJOR }}.${{ env.MINOR }}

Containerfile

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,6 @@ RUN go mod tidy && \
1616

1717
FROM scratch
1818

19-
ARG BUILD_DATE="1970-01-01T00:00:00Z" \
20-
VERSION="dev" \
21-
REVISION="dev"
22-
23-
LABEL org.opencontainers.image.title="gitlab-sync" \
24-
org.opencontainers.image.description="synchronize GitLab projects and groups between two GitLab instances" \
25-
org.opencontainers.image.source="${SOURCE}" \
26-
org.opencontainers.image.url="ghcr.io/boxboxjason/gitlab-sync" \
27-
org.opencontainers.image.created="${BUILD_DATE}" \
28-
org.opencontainers.image.revision="${REVISION}" \
29-
org.opencontainers.image.version="${VERSION}" \
30-
org.opencontainers.image.vendor="boxboxjason"
31-
3219
COPY --from=build /app/bin/gitlab-sync /usr/local/bin/gitlab-sync
3320

3421
ENTRYPOINT [ "/usr/local/bin/gitlab-sync" ]

0 commit comments

Comments
 (0)