Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Mafyuh/iac
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 033bfead9173369ae4c88c55507564aa310fee45
Choose a base ref
..
head repository: Mafyuh/iac
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3dcaf9aff4300020a38c3b8af84edb96c4dd1b61
Choose a head ref
Showing with 2 additions and 21 deletions.
  1. +2 −21 .forgejo/workflows/CD.yml
23 changes: 2 additions & 21 deletions .forgejo/workflows/CD.yml
Original file line number Diff line number Diff line change
@@ -20,32 +20,13 @@ jobs:
if [ "$(git rev-parse --is-shallow-repository)" = "true" ]; then
git fetch --unshallow
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 '^iac/docker/' | cut -d/ -f3 | 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 <<< "${{ needs.deploy.outputs.folders }}"
IFS=' ' read -r -a folder_array <<< "${{ steps.detect-changes.outputs.folders }}"
for folder in "${folder_array[@]}"; do
case $folder in
arrs)