File tree 1 file changed +21
-2
lines changed
1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -20,13 +20,32 @@ jobs:
20
20
if [ "$(git rev-parse --is-shallow-repository)" = "true" ]; then
21
21
git fetch --unshallow
22
22
fi
23
- folders=$(git diff --name-only HEAD~1 HEAD | grep '^iac/ docker/' | cut -d/ -f3 | sort | uniq)
23
+ folders=$(git diff --name-only HEAD~1 HEAD | grep '^docker/' | cut -d/ -f2 | sort | uniq)
24
24
echo "Modified folders: $folders"
25
25
echo "::set-output name=folders::$folders"
26
26
27
+ - name : Set condition for deployment
28
+ id : set-condition
29
+ run : |
30
+ if [ -z "${{ steps.detect-changes.outputs.folders }}" ]; then
31
+ echo "No relevant changes detected."
32
+ echo "::set-output name=continue::false"
33
+ else
34
+ echo "Relevant changes detected."
35
+ echo "::set-output name=continue::true"
36
+ fi
37
+
38
+ conditional-deploy :
39
+ if : needs.deploy.outputs.continue == 'true'
40
+ runs-on : ubuntu-22.04
41
+ needs : deploy
42
+ steps :
43
+ - name : Checkout repository
44
+ uses : actions/checkout@v4
45
+
27
46
- name : Deploy to hosts
28
47
run : |
29
- IFS=' ' read -r -a folder_array <<< "${{ steps.detect-changes .outputs.folders }}"
48
+ IFS=' ' read -r -a folder_array <<< "${{ needs.deploy .outputs.folders }}"
30
49
for folder in "${folder_array[@]}"; do
31
50
case $folder in
32
51
arrs)
You can’t perform that action at this time.
0 commit comments