split build and push

This commit is contained in:
Lukas Kreussel
2025-09-09 20:44:38 +02:00
parent 55a809eddf
commit 6670667f65

View File

@@ -34,8 +34,6 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver: docker
- name: Log in to Container Registry
if: github.event_name != 'pull_request'
@@ -68,24 +66,41 @@ jobs:
type=sha,enable=${{ github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) }}
- name: Build and push Docker image
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
uses: docker/build-push-action@v5
with:
context: .
platforms: ${{ matrix.platform }}
push: ${{ github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) }}
outputs: type=registry
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
provenance: false
sbom: false
cache-from: |
type=gha,scope=${{ steps.platform.outputs.suffix }}
type=registry,ref=${{ env.REGISTRY }}/${{ steps.repo.outputs.name }}:ui-cache-${{ steps.platform.outputs.suffix }}
type=registry,ref=${{ env.REGISTRY }}/${{ steps.repo.outputs.name }}:rust-deps-cache-${{ steps.platform.outputs.suffix }}
type=registry,ref=${{ env.REGISTRY }}/${{ steps.repo.outputs.name }}:cache-${{ steps.platform.outputs.suffix }}
cache-to: |
type=gha,scope=${{ steps.platform.outputs.suffix }},mode=max
build-args: |
BUILDKIT_INLINE_CACHE=1
- name: Build Docker image (PR)
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v5
with:
context: .
platforms: ${{ matrix.platform }}
outputs: type=docker
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
provenance: false
sbom: false
cache-from: |
type=gha,scope=${{ steps.platform.outputs.suffix }}
type=registry,ref=${{ env.REGISTRY }}/${{ steps.repo.outputs.name }}:cache-${{ steps.platform.outputs.suffix }}
build-args: |
BUILDKIT_INLINE_CACHE=1
create-manifest:
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
needs: build-and-push