Update .forgejo/workflows/CD.yml

This commit is contained in:
Matt Reeves 2024-06-09 05:14:07 +00:00
parent eb61a19097
commit 95693084cc

View file

@ -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"
echo "Deployment for $folder completed successfully"
done done
echo "Deployment for $folder completed successfully"