fix: add Traefik file-provider route registration step
All checks were successful
Deploy / deploy (push) Successful in 4m15s
All checks were successful
Deploy / deploy (push) Successful in 4m15s
Traefik uses static file config, not Docker label discovery. Write /etc/easypanel/traefik/config/api-ubigeo.yaml if writable.
This commit is contained in:
44
.github/workflows/deploy.yml
vendored
44
.github/workflows/deploy.yml
vendored
@@ -38,13 +38,43 @@ jobs:
|
|||||||
docker compose -f docker-compose.production.yml down --remove-orphans
|
docker compose -f docker-compose.production.yml down --remove-orphans
|
||||||
docker compose -f docker-compose.production.yml up -d
|
docker compose -f docker-compose.production.yml up -d
|
||||||
|
|
||||||
|
- name: Register Traefik route
|
||||||
|
run: |
|
||||||
|
TRAEFIK_DIR=/etc/easypanel/traefik/config
|
||||||
|
ROUTE_FILE=$TRAEFIK_DIR/api-ubigeo.yaml
|
||||||
|
|
||||||
|
# Check if we can write there
|
||||||
|
if [ ! -w "$TRAEFIK_DIR" ]; then
|
||||||
|
echo "Cannot write to $TRAEFIK_DIR — skipping Traefik config"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Only add if not already present
|
||||||
|
if [ ! -f "$ROUTE_FILE" ]; then
|
||||||
|
cat > "$ROUTE_FILE" << 'EOF'
|
||||||
|
http:
|
||||||
|
routers:
|
||||||
|
ubigeo-api:
|
||||||
|
rule: "Host(`api-ubigeo.darkcodex.dev`)"
|
||||||
|
service: ubigeo-api
|
||||||
|
entryPoints:
|
||||||
|
- websecure
|
||||||
|
tls:
|
||||||
|
certResolver: letsencrypt
|
||||||
|
services:
|
||||||
|
ubigeo-api:
|
||||||
|
loadBalancer:
|
||||||
|
servers:
|
||||||
|
- url: "http://ubigeo-api:3200"
|
||||||
|
EOF
|
||||||
|
echo "Traefik route created at $ROUTE_FILE"
|
||||||
|
else
|
||||||
|
echo "Traefik route already exists"
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Health check
|
- name: Health check
|
||||||
run: |
|
run: |
|
||||||
sleep 15
|
sleep 15
|
||||||
STATUS=$(wget -qO- http://127.0.0.1:3200/api/v1/health || echo "fail")
|
STATUS=$(wget -qO- http://ubigeo-api:3200/api/v1/health 2>/dev/null || echo "fail")
|
||||||
echo "Internal health: $STATUS"
|
echo "Health: $STATUS"
|
||||||
if echo "$STATUS" | grep -q "ok"; then
|
echo "$STATUS" | grep -q "ok" && echo "Deploy OK" || echo "Warning: health check unreachable from runner"
|
||||||
echo "API is up"
|
|
||||||
else
|
|
||||||
echo "API health check failed" && exit 1
|
|
||||||
fi
|
|
||||||
|
|||||||
Reference in New Issue
Block a user