Skip to content

Commit

Permalink
Fix the conditional testing and deploying
Browse files Browse the repository at this point in the history
  • Loading branch information
joseph-flinn committed Aug 19, 2023
1 parent 79426d4 commit d71f233
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-n-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ jobs:
DATA_DIFF=$(git diff --name-only HEAD~1 -- data/* | wc -l | xargs)
BACKEND_DIFF=$(git diff --name-only HEAD~1 -- backend/* | wc -l | xargs)
if [[ "$FRONTEND_DIFF" == "1" ]]; then
if [[ "$FRONTEND_DIFF" != "0" ]]; then
echo "frontend-changed=true" >> $GITHUB_OUTPUT
fi
if [[ "$DATA_DIFF" == "1" ]]; then
if [[ "$DATA_DIFF" != "0" ]]; then
echo "data-changed=true" >> $GITHUB_OUTPUT
fi
if [[ "$BACKEND_DIFF" == "1" ]]; then
if [[ "$BACKEND_DIFF" != "0" ]]; then
echo "backend-changed=true" >> $GITHUB_OUTPUT
fi
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0

- name: Detect Changes
id: changes
Expand All @@ -27,15 +29,15 @@ jobs:
DATA_DIFF=$(git diff --name-only origin/main -- data/* | wc -l | xargs)
BACKEND_DIFF=$(git diff --name-only origin/main -- backend/* | wc -l | xargs)
if [[ "$FRONTEND_DIFF" == "1" ]]; then
if [[ "$FRONTEND_DIFF" != "0" ]]; then
echo "frontend-changed=true" >> $GITHUB_OUTPUT
fi
if [[ "$DATA_DIFF" == "1" ]]; then
if [[ "$DATA_DIFF" != "0" ]]; then
echo "data-changed=true" >> $GITHUB_OUTPUT
fi
if [[ "$BACKEND_DIFF" == "1" ]]; then
if [[ "$BACKEND_DIFF" != "0" ]]; then
echo "backend-changed=true" >> $GITHUB_OUTPUT
fi
Expand Down

0 comments on commit d71f233

Please sign in to comment.