Skip to content

Commit bc96cb5

Browse files
fynnosbigabig
authored andcommitted
frontend checks to rebuild backend on changes
1 parent 3b9646d commit bc96cb5

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

.github/workflows/frontend_checks.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
API_WORKERS: 1
1717
VITE_APP_SERVER: http://localhost:13120
1818
COMPOSE_PROFILES: "weaviate,background,backend,frontend"
19-
BACKEND_HAS_NEW_REQUIREMENTS: false
19+
BACKEND_HAS_CHANGED: false
2020
RAY_HAS_CHANGED: false
2121
steps:
2222
- uses: actions/checkout@v3
@@ -27,21 +27,21 @@ jobs:
2727
env:
2828
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2929
run: gh pr checkout ${{ github.event.pull_request.number }}
30-
- name: Check for new backend requirements (pull request)
31-
id: check_backend_requirements_pr
30+
- name: Check for backend changes (pull request)
31+
id: check_backend_changes_pr
3232
if: github.event_name == 'pull_request'
3333
run: |
3434
git fetch origin ${{ github.event.pull_request.base.ref }}
3535
base_branch="origin/${{ github.event.pull_request.base.ref }}"
36-
if git diff --name-only $base_branch HEAD | grep -q -e '^backend/uv.lock'; then
37-
echo "BACKEND_HAS_NEW_REQUIREMENTS=true" >> $GITHUB_ENV
36+
if git diff --name-only $base_branch HEAD | grep -q -e '^backend/'; then
37+
echo "BACKEND_HAS_CHANGED=true" >> $GITHUB_ENV
3838
fi
39-
- name: Check for new backend requirements (push)
40-
id: check_backend_requirements_push
39+
- name: Check for backend changes (push)
40+
id: check_backend_changes_push
4141
if: github.event_name == 'push'
4242
run: |
43-
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q -e '^backend/uv.lock'; then
44-
echo "BACKEND_HAS_NEW_REQUIREMENTS=true" >> $GITHUB_ENV
43+
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q -e '^backend/'; then
44+
echo "BACKEND_HAS_CHANGED=true" >> $GITHUB_ENV
4545
fi
4646
- name: Check for changes in ray_model_worker (pull request)
4747
id: check_ray_model_worker_changes_pr
@@ -65,7 +65,7 @@ jobs:
6565
./bin/setup-envs.sh --project_name action-runner --port_prefix 131
6666
sed -i 's/\(DATS_FRONTEND_DOCKER_VERSION=[0-9.]*\)/\1-${{ github.run_id }}/' docker/.env
6767
sed -i 's/^RAY_DEVICE_IDS=.*/RAY_DEVICE_IDS=1/' docker/.env
68-
if [ "${{ env.BACKEND_HAS_NEW_REQUIREMENTS }}" = "true" ]; then
68+
if [ "${{ env.BACKEND_HAS_CHANGED }}" = "true" ]; then
6969
sed -i 's/\(DATS_BACKEND_DOCKER_VERSION=[0-9.]*\)/\1-${{ github.run_id }}/' docker/.env
7070
fi
7171
if [ "${{ env.RAY_HAS_CHANGED }}" = "true" ]; then
@@ -84,7 +84,7 @@ jobs:
8484
docker compose -f compose.ray.yml build
8585
docker compose -f compose.ray.yml up --wait
8686
fi
87-
if [ "${{ env.BACKEND_HAS_NEW_REQUIREMENTS }}" = "true" ]; then
87+
if [ "${{ env.BACKEND_HAS_CHANGED }}" = "true" ]; then
8888
docker compose build dats-backend-api
8989
fi
9090
docker compose build dats-frontend
@@ -121,7 +121,7 @@ jobs:
121121
docker rmi $RAY_IMAGE
122122
fi
123123
docker compose down -v
124-
if [ "${{ env.BACKEND_HAS_NEW_REQUIREMENTS }}" = "true" ]; then
124+
if [ "${{ env.BACKEND_HAS_CHANGED }}" = "true" ]; then
125125
BACKEND_IMAGE=uhhlt/dats_backend:$(grep -oP 'DATS_BACKEND_DOCKER_VERSION=\K.*' .env)
126126
docker rmi $BACKEND_IMAGE
127127
fi

0 commit comments

Comments
 (0)