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:
|
on:
|
||||||
push:
|
pull_request:
|
||||||
branches:
|
types: [closed]
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
|
if: github.event.pull_request.merged == true
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
@ -20,10 +19,9 @@ jobs:
|
||||||
|
|
||||||
- name: Deploy to Hosts
|
- name: Deploy to Hosts
|
||||||
run: |
|
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
|
do
|
||||||
echo "Deploying to $folder"
|
echo "Deploying to $folder"
|
||||||
./scripts/deploy.sh $folder
|
./scripts/deploy.sh "$folder"
|
||||||
done
|
|
||||||
|
|
||||||
echo "Deployment for $folder completed successfully"
|
echo "Deployment for $folder completed successfully"
|
||||||
|
done
|
||||||
|
|
Reference in a new issue