Update .forgejo/workflows/CD.yml
This commit is contained in:
parent
eb61a19097
commit
95693084cc
1 changed files with 7 additions and 9 deletions
|
@ -1,13 +1,12 @@
|
|||
name: Continuous Deployment
|
||||
|
||||
name: Deploy to Hosts
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
types: [closed]
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: docker
|
||||
if: github.event.pull_request.merged == true
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
@ -20,10 +19,9 @@ jobs:
|
|||
|
||||
- name: Deploy to Hosts
|
||||
run: |
|
||||
for folder in $(git diff-tree --no-commit-id --name-only -r ${{ github.sha }} | cut -d/ -f1 | sort | uniq)
|
||||
for folder in $(git diff-tree --no-commit-id --name-only -r "${{ github.event.pull_request.merge_commit_sha }}" | cut -d/ -f1 | sort | uniq)
|
||||
do
|
||||
echo "Deploying to $folder"
|
||||
./scripts/deploy.sh $folder
|
||||
./scripts/deploy.sh "$folder"
|
||||
echo "Deployment for $folder completed successfully"
|
||||
done
|
||||
|
||||
echo "Deployment for $folder completed successfully"
|
||||
|
|
Reference in a new issue