Skip to content

Update determine-changes.yml #3

Update determine-changes.yml

Update determine-changes.yml #3

name: CDK Deploy on Change
on:
push:
pull_request:
workflow_dispatch:
jobs:
determine_stacks:
runs-on: ubuntu-latest
steps:
- name: Get Changed Files
id: files
uses: Ana06/get-changed-files@v2.1.0
with:
format: 'json'
- name: Determine Stacks to Deploy
id: determine_stacks
run: |
echo "Output Files: ${{ steps.files.outputs.files }}
echo "Output All: ${{ steps.files.outputs.all }}
CHANGED_FILES='${{ steps.files.outputs.all }}'
DEPLOY_STACKS=""
echo "Changed files: $CHANGED_FILES"
if [[ "$CHANGED_FILES" == *"public/"* ]]; then
DEPLOY_STACKS="Service1Stack "
fi
if [[ "$CHANGED_FILES" == *".github/"* ]]; then
DEPLOY_STACKS+="Service2Stack "
fi
# Add more services as needed
echo "Stacks to deploy: $DEPLOY_STACKS"
echo "::set-output name=stacks::$DEPLOY_STACKS"