Skip to content

Commit

Permalink
ci: branch specific pre-deploy check on pull request action (#236)
Browse files Browse the repository at this point in the history
Run cdk diff on specific stage based on the target branch in pre
deployment action.
  • Loading branch information
anayeaye authored Oct 12, 2023
2 parents 8965651 + 60e894b commit 496e99f
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,17 @@ jobs:
python -m pip install --upgrade pip
python -m pip install -e .[dev,deploy,test]
- name: Get dev environment configuration for develop branch
run: ./scripts/get-env.sh "veda-backend-uah-dev-env"

- name: Get environment configuration for target branch
run: |
if [ "${{ github.base_ref }}" == "main" ]; then
./scripts/get-env.sh "veda-backend-uah-staging-env"
elif [ "${{ github.base_ref }}" == "develop" ]; then
./scripts/get-env.sh "veda-backend-uah-dev-env"
else
echo "No environment associated with ${GITHUB_REF##*/} branch. Test changes against dev stack"
./scripts/get-env.sh "veda-backend-uah-dev-env"
fi
- name: Pre deployment CDK diff
run: |
echo $STAGE
cdk diff veda-backend-uah-dev
cdk diff

0 comments on commit 496e99f

Please sign in to comment.