mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
Update deploy.yml
This commit is contained in:
4
.github/workflows/deploy.yml
vendored
4
.github/workflows/deploy.yml
vendored
@@ -30,6 +30,7 @@ jobs:
|
|||||||
id: filter
|
id: filter
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
ALL_SERVICES=(
|
ALL_SERVICES=(
|
||||||
"freight-api"
|
"freight-api"
|
||||||
"passenger-api"
|
"passenger-api"
|
||||||
@@ -55,7 +56,6 @@ jobs:
|
|||||||
|
|
||||||
GLOBAL_PATTERN="^[.]github/|^docker-compose[.]yaml$|^turbo[.]json$|^tsconfig[.]json$|^tsconfig[.]base[.]json$|^pnpm-workspace[.]yaml$|^pnpm-lock[.]yaml$|^package[.]json$|^[.]env([.][a-z]+)?$|^packages/|^infrastructure/|^scripts/deploy/|^wagon.*[.]ts$|^cargo.*[.]ts$|^container.*[.]ts$|^use-.*[.]ts$|^.*[.]service[.]ts$|^.*[.]entity[.]ts$|^.*-types[.]ts$"
|
GLOBAL_PATTERN="^[.]github/|^docker-compose[.]yaml$|^turbo[.]json$|^tsconfig[.]json$|^tsconfig[.]base[.]json$|^pnpm-workspace[.]yaml$|^pnpm-lock[.]yaml$|^package[.]json$|^[.]env([.][a-z]+)?$|^packages/|^infrastructure/|^scripts/deploy/|^wagon.*[.]ts$|^cargo.*[.]ts$|^container.*[.]ts$|^use-.*[.]ts$|^.*[.]service[.]ts$|^.*[.]entity[.]ts$|^.*-types[.]ts$"
|
||||||
|
|
||||||
# Tier 1: skip if only non-deployable files changed
|
|
||||||
DEPLOYABLE=$(echo "$CHANGED" | grep -vE "$NON_DEPLOYABLE_PATTERN" || true)
|
DEPLOYABLE=$(echo "$CHANGED" | grep -vE "$NON_DEPLOYABLE_PATTERN" || true)
|
||||||
if [ -z "$DEPLOYABLE" ]; then
|
if [ -z "$DEPLOYABLE" ]; then
|
||||||
echo "Only non-deployable files changed. Skipping deploy."
|
echo "Only non-deployable files changed. Skipping deploy."
|
||||||
@@ -63,7 +63,6 @@ jobs:
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Tier 2: deploy all if any global file changed
|
|
||||||
if echo "$CHANGED" | grep -qE "$GLOBAL_PATTERN"; then
|
if echo "$CHANGED" | grep -qE "$GLOBAL_PATTERN"; then
|
||||||
echo "Global file(s) changed — deploying all services."
|
echo "Global file(s) changed — deploying all services."
|
||||||
JSON=$(printf '%s\n' "${ALL_SERVICES[@]}" | jq -R . | jq -sc .)
|
JSON=$(printf '%s\n' "${ALL_SERVICES[@]}" | jq -R . | jq -sc .)
|
||||||
@@ -71,7 +70,6 @@ jobs:
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Tier 3: per-service paths
|
|
||||||
echo "$CHANGED" | grep -q "^apps/edr-freight-api/" && SERVICES+=("freight-api")
|
echo "$CHANGED" | grep -q "^apps/edr-freight-api/" && SERVICES+=("freight-api")
|
||||||
echo "$CHANGED" | grep -q "^apps/edr-passenger-api/" && SERVICES+=("passenger-api")
|
echo "$CHANGED" | grep -q "^apps/edr-passenger-api/" && SERVICES+=("passenger-api")
|
||||||
echo "$CHANGED" | grep -q "^apps/edr-passenger-web/portal/" && SERVICES+=("passenger-portal")
|
echo "$CHANGED" | grep -q "^apps/edr-passenger-web/portal/" && SERVICES+=("passenger-portal")
|
||||||
|
|||||||
Reference in New Issue
Block a user