Skip to content

Commit 4907fb4

Browse files
committed
add docker push to release
1 parent 6dae8f6 commit 4907fb4

File tree

2 files changed

+46
-25
lines changed

2 files changed

+46
-25
lines changed

.github/workflows/docker.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
tags:
66
- 'v*'
77

8+
env:
9+
REGISTRY: ghcr.io
10+
IMAGE_NAME: ${{ github.repository }}
11+
812
jobs:
913
build:
1014
runs-on: ubuntu-24.04
@@ -80,3 +84,45 @@ jobs:
8084
makeLatest: true
8185
generateReleaseNotes: true
8286
artifacts: "cortex-tenant,*.deb,*.rpm"
87+
88+
publish-docker-image:
89+
runs-on: ubuntu-24.04
90+
91+
permissions:
92+
contents: read
93+
packages: write
94+
attestations: write
95+
id-token: write
96+
97+
steps:
98+
- name: Checkout repository
99+
uses: actions/checkout@v4
100+
101+
- name: Log in to the Container registry
102+
uses: docker/login-action@v3
103+
with:
104+
registry: ${{ env.REGISTRY }}
105+
username: ${{ github.actor }}
106+
password: ${{ secrets.GITHUB_TOKEN }}
107+
108+
- name: Extract metadata (tags, labels) for Docker
109+
id: meta
110+
uses: docker/metadata-action@v5
111+
with:
112+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
113+
114+
- name: Build and push Docker image
115+
id: push
116+
uses: docker/build-push-action@v6
117+
with:
118+
context: .
119+
push: true
120+
tags: ${{ steps.meta.outputs.tags }}
121+
labels: ${{ steps.meta.outputs.labels }}
122+
123+
- name: Generate artifact attestation
124+
uses: actions/attest-build-provenance@v2
125+
with:
126+
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
127+
subject-digest: ${{ steps.push.outputs.digest }}
128+
push-to-registry: true

0 commit comments

Comments
 (0)