Skip to content

Commit 81b01fd

Browse files
codethinkicodethinki
andauthored
Master/move docker cache to flashmini cache (#9)
--------- Co-authored-by: codethinki <lukas.jmy@outlook.de>
1 parent a24af12 commit 81b01fd

3 files changed

Lines changed: 25 additions & 7 deletions

File tree

.github/actions/build-container/action.yml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,29 @@ inputs:
77
tag:
88
description: 'Tag suffix for the image'
99
required: true
10+
image-subdir:
11+
description: 'Subdirectory to push image to'
12+
default: 'cache'
13+
14+
outputs:
15+
container-image-adress:
16+
description: Address of container image
17+
value: ${{ steps.set-image.outputs.image }}
1018

1119
runs:
1220
using: "composite"
1321
steps:
1422
- name: Set up Docker Buildx
1523
uses: docker/setup-buildx-action@v3
1624

25+
- name: Set image names
26+
id: set-image
27+
shell: bash
28+
run: |
29+
image="ghcr.io/${{ github.repository }}/${{ inputs.image-subdir }}:${{ inputs.tag }}"
30+
echo "image=$image" >> $GITHUB_OUTPUT
31+
echo "cache_image=${image}-cache" >> $GITHUB_OUTPUT
32+
1733
- name: Log in to the Container registry
1834
uses: docker/login-action@v3
1935
with:
@@ -27,6 +43,6 @@ runs:
2743
context: .
2844
file: ${{ inputs.dockerfile }}
2945
push: true
30-
tags: ghcr.io/${{ github.repository }}:${{ inputs.tag }}
31-
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:${{ inputs.tag }}-cache
32-
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}:${{ inputs.tag }}-cache,mode=max
46+
tags: ${{ steps.set-image.outputs.image }}
47+
cache-from: type=registry,ref=${{ steps.set-image.outputs.cache_image }}
48+
cache-to: type=registry,ref=${{ steps.set-image.outputs.cache_image }},mode=max

.github/workflows/build-test.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ name: Build & Test
33
on:
44
push: { branches: ["master", "_master/add_ci"] }
55
pull_request: { branches: ["master"] }
6-
workflow_dispatch:
76

87
permissions: { contents: read, packages: write }
98

.github/workflows/linux-pipeline.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,23 @@ jobs:
2121
prepare:
2222
name: Build Container (${{ inputs.backend }})
2323
runs-on: ubuntu-latest
24+
outputs:
25+
container-image-adress: ${{ steps.build.outputs.container-image-adress }}
2426
steps:
2527
- uses: actions/checkout@v4
26-
- name: Build & Push
28+
- id: build
29+
name: Build & Push
2730
uses: ./.github/actions/build-container
2831
with:
2932
dockerfile: ci/docker/linux/Dockerfile.${{ inputs.backend }}
30-
tag: linux-${{ inputs.backend }}
33+
tag: linux-${{ inputs.backend }}-container
3134

3235
build:
3336
name: Linux (${{ inputs.compiler }}-${{ inputs.backend }})
3437
needs: prepare
3538
runs-on: ubuntu-latest
3639
container:
37-
image: ghcr.io/${{ github.repository }}:linux-${{ inputs.backend }}
40+
image: ${{ needs.prepare.outputs.container-image-adress }}
3841
credentials:
3942
username: ${{ github.actor }}
4043
password: ${{ github.token }}

0 commit comments

Comments
 (0)