Skip to content

Commit 08efd4b

Browse files
Ensure build retagging hits the cache
1 parent 93cb1ac commit 08efd4b

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

.github/workflows/build.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@ name: Build / Test / Push
33
on:
44
push:
55
branches:
6-
- '*'
6+
- '**'
77
workflow_dispatch:
88

9+
env:
10+
DOCKER_METADATA_SET_OUTPUT_ENV: 'true'
11+
912
jobs:
1013
build:
1114
runs-on: ubuntu-latest
@@ -78,6 +81,8 @@ jobs:
7881
needs:
7982
- build
8083
- test
84+
env:
85+
DOCKER_APP_IMAGE: ${{ needs.build.outputs.build-image }}
8186
steps:
8287
- name: Checkout code
8388
uses: actions/checkout@v4
@@ -100,9 +105,7 @@ jobs:
100105
type=raw,value=latest,enable={{is_default_branch}}
101106
102107
- name: Retag and push the image
103-
uses: docker/build-push-action@v6
104-
with:
105-
cache-from: type=registry,ref=${{ needs.build.outputs.build-image }}
106-
labels: ${{ steps.branch-meta.outputs.labels }}
107-
push: true
108-
tags: ${{ steps.branch-meta.outputs.tags }}
108+
run: |
109+
docker pull "$DOCKER_APP_IMAGE"
110+
echo "$DOCKER_METADATA_OUTPUT_TAGS" | tr ' ' '\n' | xargs -n1 docker tag "$DOCKER_APP_IMAGE"
111+
docker push --all-tags "$(echo "$DOCKER_APP_IMAGE" | cut -f1 -d:)"

0 commit comments

Comments
 (0)