Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also 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: 3dcaf9aff4300020a38c3b8af84edb96c4dd1b61
Choose a base ref
...
head repository: Mafyuh/iac
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 033bfead9173369ae4c88c55507564aa310fee45
Choose a head ref
  • 4 commits
  • 1 file changed
  • 1 contributor

Commits on Jul 24, 2024

  1. Update .forgejo/workflows/CD.yml

    mafyuh committed Jul 24, 2024
    Copy the full SHA
    c3148d6 View commit details
  2. Update .forgejo/workflows/CD.yml

    mafyuh committed Jul 24, 2024
    Copy the full SHA
    31ae897 View commit details
  3. Update .forgejo/workflows/CD.yml

    mafyuh committed Jul 24, 2024
    Copy the full SHA
    11c2c2c View commit details
  4. Copy the full SHA
    033bfea View commit details
Showing with 21 additions and 2 deletions.
  1. +21 −2 .forgejo/workflows/CD.yml
23 changes: 21 additions & 2 deletions .forgejo/workflows/CD.yml
Original file line number Diff line number Diff line change
@@ -20,13 +20,32 @@ jobs:
if [ "$(git rev-parse --is-shallow-repository)" = "true" ]; then
git fetch --unshallow
fi
folders=$(git diff --name-only HEAD~1 HEAD | grep '^iac/docker/' | cut -d/ -f3 | sort | uniq)
folders=$(git diff --name-only HEAD~1 HEAD | grep '^docker/' | cut -d/ -f2 | 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 <<< "${{ steps.detect-changes.outputs.folders }}"
IFS=' ' read -r -a folder_array <<< "${{ needs.deploy.outputs.folders }}"
for folder in "${folder_array[@]}"; do
case $folder in
arrs)