Deploy App / deploy (push) Successful in 21s
busybox-wget loest localhost nach ::1 auf, nginx lauschte nur auf IPv4. Der Healthcheck schlug damit dauerhaft fehl, der Container blieb 'starting', und Traefik nimmt Container ohne 'healthy'-Status nicht in die Routing-Tabelle auf. Daher 404 trotz korrekter Labels. - Healthcheck auf 127.0.0.1 - nginx lauscht zusaetzlich auf IPv6 - Workflow wartet auf 'healthy' und prueft den Router Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
33 lines
1.1 KiB
YAML
33 lines
1.1 KiB
YAML
name: Deploy App
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v4
|
|
- name: Deploy to Server
|
|
run: |
|
|
APP_DIR="/opt/aicds/apps/${GITHUB_REPOSITORY#*/}"
|
|
mkdir -p $APP_DIR
|
|
cp -a . $APP_DIR/
|
|
cd $APP_DIR
|
|
docker compose down || true
|
|
docker compose up -d --build
|
|
docker image prune -f
|
|
- name: Bereitschaft pruefen
|
|
run: |
|
|
cd "/opt/aicds/apps/${GITHUB_REPOSITORY#*/}"
|
|
for i in $(seq 1 12); do
|
|
H=$(docker inspect -f '{{.State.Health.Status}}' gartenvisualisierung-app-1 2>/dev/null || echo "-")
|
|
echo "Versuch $i: health=$H"
|
|
[ "$H" = "healthy" ] && break
|
|
sleep 10
|
|
done
|
|
docker inspect -f 'health={{.State.Health.Status}}' gartenvisualisierung-app-1
|
|
docker run --rm --network agent-net curlimages/curl:latest -sk -o /dev/null \
|
|
-w 'Router garten: %{http_code}\n' --max-time 10 -H 'Host: garten.aicds.ch' https://traefik/ || true
|