Skip to content

Commit 87f2f36

Browse files
committed
Add pushing back into _container conditional on needs.test.result
1 parent feb4bc1 commit 87f2f36

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

.github/workflows/_container.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,25 @@ jobs:
3636

3737
- name: Test cli works in cached runtime image
3838
run: docker run --rm tag_for_testing --version
39+
40+
- name: Create tags for publishing image
41+
id: meta
42+
uses: docker/metadata-action@v5
43+
with:
44+
images: ghcr.io/${{ github.repository }}
45+
tags: |
46+
type=ref,event=tag
47+
type=raw,value=latest
48+
49+
- name: Push cached image to container registry
50+
if: needs.test.result && github.ref_type == 'tag'
51+
uses: docker/build-push-action@v6
52+
env:
53+
DOCKER_BUILD_RECORD_UPLOAD: false
54+
# This does not build the image again, it will find the image in the
55+
# Docker cache and publish it
56+
with:
57+
context: .
58+
push: true
59+
tags: ${{ steps.meta.outputs.tags }}
60+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)