Compare commits

...

4 commits

Author SHA1 Message Date
033bfead91 Merge branch 'main' into renovate/ghcr.io-linuxserver-bazarr
Some checks failed
Lint on PR / Lint YAML files (pull_request) Successful in 5s
Deploy to Hosts / deploy (pull_request) Has been cancelled
Deploy to Hosts / conditional-deploy (pull_request) Has been cancelled
2024-07-23 21:48:29 -04:00
11c2c2c82d Update .forgejo/workflows/CD.yml 2024-07-23 21:48:22 -04:00
31ae8971bf Update .forgejo/workflows/CD.yml 2024-07-23 21:47:12 -04:00
c3148d6604 Update .forgejo/workflows/CD.yml 2024-07-23 21:38:46 -04:00

View file

@ -20,13 +20,32 @@ jobs:
if [ "$(git rev-parse --is-shallow-repository)" = "true" ]; then
git fetch --unshallow
fi
folders=$(git diff --name-only HEAD~1 HEAD | grep '^iac/docker/' | cut -d/ -f3 | sort | uniq)
folders=$(git diff --name-only HEAD~1 HEAD | grep '^docker/' | cut -d/ -f2 | sort | uniq)
echo "Modified folders: $folders"
echo "::set-output name=folders::$folders"
- name: Set condition for deployment
id: set-condition
run: |
if [ -z "${{ steps.detect-changes.outputs.folders }}" ]; then
echo "No relevant changes detected."
echo "::set-output name=continue::false"
else
echo "Relevant changes detected."
echo "::set-output name=continue::true"
fi
conditional-deploy:
if: needs.deploy.outputs.continue == 'true'
runs-on: ubuntu-22.04
needs: deploy
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Deploy to hosts
run: |
IFS=' ' read -r -a folder_array <<< "${{ steps.detect-changes.outputs.folders }}"
IFS=' ' read -r -a folder_array <<< "${{ needs.deploy.outputs.folders }}"
for folder in "${folder_array[@]}"; do
case $folder in
arrs)