Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions .github/actions/build-container/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,29 @@ inputs:
tag:
description: 'Tag suffix for the image'
required: true
image-subdir:
description: 'Subdirectory to push image to'
default: 'cache'

outputs:
container-image-adress:
description: Address of container image
value: ${{ steps.set-image.outputs.image }}

runs:
using: "composite"
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Set image names
id: set-image
shell: bash
run: |
image="ghcr.io/${{ github.repository }}/${{ inputs.image-subdir }}:${{ inputs.tag }}"
echo "image=$image" >> $GITHUB_OUTPUT
echo "cache_image=${image}-cache" >> $GITHUB_OUTPUT

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
Expand All @@ -27,6 +43,6 @@ runs:
context: .
file: ${{ inputs.dockerfile }}
push: true
tags: ghcr.io/${{ github.repository }}:${{ inputs.tag }}
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:${{ inputs.tag }}-cache
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}:${{ inputs.tag }}-cache,mode=max
tags: ${{ steps.set-image.outputs.image }}
cache-from: type=registry,ref=${{ steps.set-image.outputs.cache_image }}
cache-to: type=registry,ref=${{ steps.set-image.outputs.cache_image }},mode=max
1 change: 0 additions & 1 deletion .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name: Build & Test
on:
push: { branches: ["master", "_master/add_ci"] }
pull_request: { branches: ["master"] }
workflow_dispatch:

permissions: { contents: read, packages: write }

Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/linux-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,23 @@ jobs:
prepare:
name: Build Container (${{ inputs.backend }})
runs-on: ubuntu-latest
outputs:
container-image-adress: ${{ steps.build.outputs.container-image-adress }}
steps:
- uses: actions/checkout@v4
- name: Build & Push
- id: build
name: Build & Push
uses: ./.github/actions/build-container
with:
dockerfile: ci/docker/linux/Dockerfile.${{ inputs.backend }}
tag: linux-${{ inputs.backend }}
tag: linux-${{ inputs.backend }}-container

build:
name: Linux (${{ inputs.compiler }}-${{ inputs.backend }})
needs: prepare
runs-on: ubuntu-latest
container:
image: ghcr.io/${{ github.repository }}:linux-${{ inputs.backend }}
image: ${{ needs.prepare.outputs.container-image-adress }}
credentials:
username: ${{ github.actor }}
password: ${{ github.token }}
Expand Down