Skip to content

Commit 9e773cd

Browse files
committed
chore: make use of multiple exporters
Signed-off-by: Bence Csati <bence.csati@axoflow.com>
1 parent c3ae75a commit 9e773cd

File tree

1 file changed

+5
-18
lines changed

1 file changed

+5
-18
lines changed

.github/workflows/artifacts.yaml

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ jobs:
6868

6969
- name: Set up Cosign
7070
uses: sigstore/cosign-installer@d7d6bc7722e3daa8354c50bcb52f4837da5e9b6a # v3.8.1
71+
if: ${{ inputs.publish }}
7172

7273
- name: Set image name
7374
id: image-name
@@ -91,24 +92,13 @@ jobs:
9192
org.opencontainers.image.authors=Kube logging authors
9293
org.opencontainers.image.documentation=https://todo.docs
9394
94-
95-
# Multiple exporters are not supported yet
96-
# See https://github.com/moby/buildkit/pull/2760
97-
- name: Determine build output
98-
uses: haya14busa/action-cond@94f77f7a80cd666cb3155084e428254fea4281fd # v1.2.1
99-
id: build-output
100-
with:
101-
cond: ${{ inputs.publish }}
102-
if_true: type=image,push=true
103-
if_false: type=oci,dest=image.tar
104-
10595
- name: Login to GitHub Container Registry
10696
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
10797
with:
10898
registry: ghcr.io
10999
username: ${{ github.actor }}
110100
password: ${{ github.token }}
111-
if: inputs.publish
101+
if: ${{ inputs.publish }}
112102

113103
- name: Build and push image
114104
id: build
@@ -120,8 +110,9 @@ jobs:
120110
labels: ${{ steps.meta.outputs.labels }}
121111
cache-from: type=gha
122112
cache-to: type=gha,mode=max
123-
outputs: ${{ steps.build-output.outputs.value }},name=target
124-
# push: ${{ inputs.publish }}
113+
outputs: |
114+
type=image,push=${{ inputs.publish }},name=target,annotation-index.org.opencontainers.image.description=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.description'] }}
115+
type=oci,dest=image.tar,name=target,annotation-index.org.opencontainers.image.description=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.description'] }}
125116
126117
- name: Sign image with GitHub OIDC Token
127118
if: ${{ inputs.publish && github.repository_owner == 'kube-logging' }} # Check if the workflow is called by the same GitHub organization
@@ -153,10 +144,6 @@ jobs:
153144
id: image-ref
154145
run: echo "value=${{ steps.image-name.outputs.value }}@${{ steps.build.outputs.digest }}" >> "$GITHUB_OUTPUT"
155146

156-
- name: Fetch image
157-
run: skopeo --insecure-policy copy docker://${{ steps.image-name.outputs.value }}:${{ steps.meta.outputs.version }} oci-archive:image.tar
158-
if: inputs.publish
159-
160147
- name: Extract OCI tarball
161148
run: |
162149
mkdir -p image

0 commit comments

Comments
 (0)