Skip to content

Commit a6a887a

Browse files
committed
ci: fix cache ref
1 parent be9899b commit a6a887a

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ concurrency:
1212
group: ${{ github.workflow }}
1313

1414
env:
15-
REGISTRY_NAME: ghcr.io/octoprint/custopizer
15+
REGISTRY_NAME: ghcr.io
16+
IMAGE_NAME: octoprint/custopizer
1617

1718
jobs:
1819
build:
@@ -45,7 +46,7 @@ jobs:
4546
id: meta
4647
uses: docker/metadata-action@v5
4748
with:
48-
images: ${{ env.REGISTRY_NAME }}
49+
images: ${{ env.REGISTRY_NAME }}/${{ env.IMAGE_NAME }}
4950

5051
- name: "🐳 Set up Docker Buildx"
5152
uses: docker/setup-buildx-action@v3
@@ -61,11 +62,11 @@ jobs:
6162
labels: ${{ steps.meta.outputs.labels }}
6263

6364
# inline cache
64-
cache-from: type=registry,ref=${{ steps.meta.outputs.tags[0] }}
65+
cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.tags[0] }}
6566
cache-to: type=inline
6667

6768
# export
68-
outputs: type=image,"name=${{ env.REGISTRY_NAME }}",push-by-digest=true,name-canonical=true,push=true
69+
outputs: type=image,"name=${{ env.REGISTRY_NAME }}/${{ env.IMAGE_NAME }}",push-by-digest=true,name-canonical=true,push=true
6970

7071

7172
test:
@@ -76,7 +77,7 @@ jobs:
7677
steps:
7778
- name: "🐳 Load image into Docker"
7879
run:
79-
IMAGE="$REGISTRY_IMAGE@sha256:${{ needs.build.outputs.digest }}"
80+
IMAGE="${{ env.REGISTRY_NAME }}/${{ env.IMAGE_NAME }}@sha256:${{ needs.build.outputs.digest }}"
8081
docker pull "$IMAGE"
8182
docker image ls -a
8283

@@ -115,7 +116,7 @@ jobs:
115116

116117
- name: "📦️ Tag image in registry"
117118
run: |
118-
IMAGE="$REGISTRY_IMAGE@sha256:${{ needs.build.outputs.digest }}"
119+
IMAGE="${{ env.REGISTRY_NAME }}/${{ env.IMAGE_NAME }}@sha256:${{ needs.build.outputs.digest }}"
119120
TAGS=$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON")
120121
121122
docker buildx imagetools create $TAGS $IMAGE

0 commit comments

Comments
 (0)