Update .forgejo/workflows/CD.yml
This commit is contained in:
parent
31ae8971bf
commit
11c2c2c82d
1 changed files with 7 additions and 4 deletions
|
@ -22,7 +22,7 @@ jobs:
|
||||||
fi
|
fi
|
||||||
folders=$(git diff --name-only HEAD~1 HEAD | grep '^docker/' | cut -d/ -f2 | sort | uniq)
|
folders=$(git diff --name-only HEAD~1 HEAD | grep '^docker/' | cut -d/ -f2 | sort | uniq)
|
||||||
echo "Modified folders: $folders"
|
echo "Modified folders: $folders"
|
||||||
echo "::set-output name=folders::$folders"
|
echo "::set-output name=folders::$folders"
|
||||||
|
|
||||||
- name: Set condition for deployment
|
- name: Set condition for deployment
|
||||||
id: set-condition
|
id: set-condition
|
||||||
|
@ -35,14 +35,17 @@ jobs:
|
||||||
echo "::set-output name=continue::true"
|
echo "::set-output name=continue::true"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if: steps.set-condition.outputs.continue == 'true'
|
conditional-deploy:
|
||||||
|
if: needs.deploy.outputs.continue == 'true'
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
needs: deploy
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Deploy to hosts
|
- name: Deploy to hosts
|
||||||
run: |
|
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
|
for folder in "${folder_array[@]}"; do
|
||||||
case $folder in
|
case $folder in
|
||||||
arrs)
|
arrs)
|
||||||
|
@ -110,4 +113,4 @@ jobs:
|
||||||
echo "Absolute End: $(echo "$logs" | jq -r '.range.absolute_end')"
|
echo "Absolute End: $(echo "$logs" | jq -r '.range.absolute_end')"
|
||||||
echo "Content:"
|
echo "Content:"
|
||||||
echo "$(echo "$logs" | jq -r '.content')"
|
echo "$(echo "$logs" | jq -r '.content')"
|
||||||
done
|
done
|
||||||
|
|
Loading…
Add table
Reference in a new issue