Skip to content

Commit b1ed44f

Browse files
committed
rewrite workflow logic
1 parent 5fc87d0 commit b1ed44f

File tree

2 files changed

+22
-16
lines changed

2 files changed

+22
-16
lines changed

.github/workflows/deploy.yml

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,16 @@ on:
1010
- lendemor/deploy_pipeline
1111

1212
jobs:
13-
setup-matrix:
14-
runs-on: ubuntu-latest
15-
outputs:
16-
folders: ${{ steps.generate-matrix.outputs.folders }}
17-
steps:
18-
- uses: actions/checkout@v3
19-
- name: Generate Matrix
20-
id: generate-matrix
21-
run: |
22-
FOLDERS=$(ls -d */ | sed 's|/||g' | jq -R -s -c 'split("\n")[:-1]')
23-
echo "folders=$FOLDERS" >> $GITHUB_OUTPUT
24-
- name: Debug output (matrix)
25-
run: |
26-
echo "Subfolders: ${{ env.folders }}"
13+
list-templates:
14+
uses: ./.github/actions/list-templates.yml
2715

2816
deploy:
29-
needs: setup-matrix
17+
needs: list-templates
3018
runs-on: ubuntu-latest
3119
environment: Cloud Deploy
3220
strategy:
3321
matrix:
34-
folder: ${{fromJson(needs.setup-matrix.outputs.folders)}}
22+
folder: ${{ fromJson(needs.list-templates.outputs.templates) }}
3523
fail-fast: false
3624
steps:
3725
- uses: actions/checkout@v3
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
on:
2+
workflow_call:
3+
4+
jobs:
5+
list-templates:
6+
runs-on: ubuntu-latest
7+
outputs:
8+
templates: ${{ steps.generate-matrix.outputs.templates }}
9+
steps:
10+
- uses: actions/checkout@v4
11+
- name: Generate Matrix
12+
id: generate-matrix
13+
run: |
14+
TEMPLATES="$(find . -not -name '.*' -maxdepth 1 -type d | cut -f2 -d/ | sort | grep -vw chakra_apps | jq -R | jq -s -c)"
15+
echo $TEMPLATES
16+
echo "templates=$TEMPLATES" >> $GITHUB_OUTPUT
17+
18+

0 commit comments

Comments
 (0)