Skip to content

Commit 033bfea

Browse files
author
Matt Reeves
committedJul 24, 2024
Merge branch 'main' into renovate/ghcr.io-linuxserver-bazarr
2 parents 3dcaf9a + 11c2c2c commit 033bfea

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed
 

‎.forgejo/workflows/CD.yml

+21-2
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,32 @@ jobs:
2020
if [ "$(git rev-parse --is-shallow-repository)" = "true" ]; then
2121
git fetch --unshallow
2222
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)
2424
echo "Modified folders: $folders"
2525
echo "::set-output name=folders::$folders"
2626
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+
2746
- name: Deploy to hosts
2847
run: |
29-
IFS=' ' read -r -a folder_array <<< "${{ steps.detect-changes.outputs.folders }}"
48+
IFS=' ' read -r -a folder_array <<< "${{ needs.deploy.outputs.folders }}"
3049
for folder in "${folder_array[@]}"; do
3150
case $folder in
3251
arrs)

0 commit comments

Comments
 (0)
Please sign in to comment.