@@ -11,76 +11,33 @@ jobs:
1111 - name : Checkout Repository
1212 uses : actions/checkout@v4
1313
14- - name : Discover theme bases
15- id : discover
16- run : |
17- # Find directories matching packages/modules/*_themes/* that contain a source/ subdir
18- mapfile -d $'\0' found < <(find packages/modules -type d -path 'packages/modules/*_themes/*' -print0)
19- theme_bases=()
20- for d in "${found[@]}"; do
21- # trim trailing NUL if any
22- d="${d%$'\0'}"
23- if [ -d "$d/source" ]; then
24- theme_bases+=("$d")
25- fi
26- done
27-
28- # Prepare newline-separated THEME_BASES output
29- {
30- echo "theme_bases<<EOF"
31- for b in "${theme_bases[@]}"; do
32- printf "%s\n" "$b"
33- done
34- echo "EOF"
35- } >> $GITHUB_OUTPUT
36-
37- # Prepare newline-separated cache paths (package-lock.json)
38- cache_paths=""
39- for b in "${theme_bases[@]}"; do
40- cache_paths="${cache_paths}${b}/source/package-lock.json\n"
41- done
42- cache_paths=${cache_paths%\\n}
43- {
44- echo "cache_paths<<EOF"
45- printf "%b" "$cache_paths"
46- echo "EOF"
47- } >> $GITHUB_OUTPUT
48-
4914 - name : Setup Node.js v24
5015 uses : actions/setup-node@v4
5116 with :
5217 node-version : 24
5318 cache : npm
54- cache-dependency-path : ${{ steps.discover.outputs.cache_paths }}
19+ cache-dependency-path : ' packages/modules/*_themes/*/source/package-lock.json '
5520
5621 - name : Install dependencies and build all themes
5722 run : |
58- theme_bases_str="${{ steps.discover.outputs.theme_bases }}"
59- # read into array splitting on newline
60- IFS=$'\n' read -r -d '' -a THEME_BASES <<< "$theme_bases_str"$'\0' || true
61- for base in "${THEME_BASES[@]}"; do
62- echo "Install and build Theme: $base"
63- if [ -d "$base/source" ]; then
64- cd "$base/source"
23+ for theme_dir in packages/modules/*_themes/*/; do
24+ if [ -d "$theme_dir/source" ]; then
25+ echo "Building theme: $theme_dir"
26+ cd "$theme_dir/source"
6527 npm install
6628 npm run build --if-present
67- cd -
68- else
69- echo "Skipping $base - no source directory"
29+ cd - > /dev/null
7030 fi
7131 done
7232
7333 - name : Commit and push built themes
7434 run : |
7535 git config user.name "GitHub Actions"
7636 git config user.email "actions@github.com"
77- theme_bases_str="${{ steps.discover.outputs.theme_bases }}"
78- IFS=$'\n' read -r -d '' -a THEME_BASES <<< "$theme_bases_str"$'\0' || true
79- for base in "${THEME_BASES[@]}"; do
80- if [ -d "$base/web" ]; then
81- git add "$base/web"
82- fi
83- done
37+
38+ # Add all built theme files
39+ git add packages/modules/*_themes/*/web/
40+
8441 if ! git diff --cached --quiet; then
8542 git commit -m "Build Themes"
8643 git push
0 commit comments