-
Notifications
You must be signed in to change notification settings - Fork 3
56 lines (48 loc) · 1.93 KB
/
Copy pathcomponentsBuild.yml
File metadata and controls
56 lines (48 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Build Components
on:
release:
types: [published]
workflow_dispatch:
jobs:
detect-folders:
runs-on: ubuntu-latest
outputs:
matrix-folders: ${{ steps.detect.outputs.matrix-folders }}
steps:
- uses: actions/checkout@v4
- id: detect
run: |
echo "🔍 Suche Komponenten..."
git fetch --prune --unshallow || true
# Wenn Release, dann baue ALLE Komponenten
if [ "${{ github.event_name }}" == "release" ]; then
echo "📦 Release Event erkannt - Baue ALLE Komponenten!"
FOLDERS=$(find components -mindepth 1 -maxdepth 1 -type d | xargs -n 1 basename | jq -R -s -c 'split("\n")[:-1]')
else
echo "🛠 Workflow Dispatch erkannt - Baue ALLE Komponenten!"
FOLDERS=$(find components -mindepth 1 -maxdepth 1 -type d | xargs -n 1 basename | jq -R -s -c 'split("\n")[:-1]')
fi
echo "📂 Gefundene Ordner: $FOLDERS"
echo "matrix-folders=$FOLDERS" >> $GITHUB_OUTPUT
docker-build:
needs: detect-folders
if: needs.detect-folders.outputs.matrix-folders != '[]' # Nur wenn etwas geändertes da ist
strategy:
matrix:
folder: ${{ fromJson(needs.detect-folders.outputs.matrix-folders) }}
name: Build Docker Image for ${{ matrix.folder }}
uses: ./.github/workflows/dockerbuild.yml
with:
dockerfile: components/${{ matrix.folder }}/deployment/docker/Dockerfile
buildContext: components/${{ matrix.folder }}
service: ${{ matrix.folder }}
helm-build:
needs: detect-folders
if: needs.detect-folders.outputs.matrix-folders != '[]' # Nur wenn etwas geändertes da ist
strategy:
matrix:
folder: ${{ fromJson(needs.detect-folders.outputs.matrix-folders) }}
name: Build Helm Chart for ${{ matrix.folder }}
uses: ./.github/workflows/helm.yml
with:
buildContext: components/${{ matrix.folder }}/deployment/helm