REFECTORED: refecotred compose and deploymend
Some checks failed
Build and Deploy / deploy (push) Failing after 2s

This commit is contained in:
2025-11-27 08:33:15 +01:00
parent 1642bdd08c
commit 9320fdf238
2 changed files with 14 additions and 16 deletions

View File

@@ -8,6 +8,7 @@ on:
- "compose.yaml"
- "config/**"
- ".gitea/workflows/build-and-deployment.yaml"
- "Dockerfile"
workflow_dispatch:
jobs:
@@ -21,19 +22,21 @@ jobs:
run: |
mkdir -p ${{ secrets.DEPLOY_PATH }}
- name: Copy compose file
run: cp compose.yaml ${{ secrets.DEPLOY_PATH }}
- name: Copy project files
run: |
cp compose.yaml ${{ secrets.DEPLOY_PATH }}
cp Dockerfile ${{ secrets.DEPLOY_PATH }}
# Kopiert das config Verzeichnis, falls es existiert
if [ -d "config" ]; then
cp -r config ${{ secrets.DEPLOY_PATH }}
fi
- name: Stop containers
run: docker compose down || true
working-directory: ${{ secrets.DEPLOY_PATH }}
- name: Pull latest images
run: docker compose pull
working-directory: ${{ secrets.DEPLOY_PATH }}
- name: Start containers with latest image
run: docker compose up -d --force-recreate
- name: Build and start containers
run: docker compose up -d --build --force-recreate
working-directory: ${{ secrets.DEPLOY_PATH }}
- name: Check running containers
@@ -42,14 +45,11 @@ jobs:
- name: Wait for container to be healthy
run: |
echo "Waiting for container to become healthy..."
# This loop will wait for up to 5 minutes for the container to report a 'healthy' status.
# It checks the status every 5 seconds. If the container doesn't become healthy
# within the timeout, the script will exit with an error, failing the workflow.
end_time=$(( $(date +%s) + 300 )) # 5 minute timeout
while [ "$(docker inspect -f {{.State.Health.Status}} tor-proxy 2>/dev/null || echo 'unhealthy')" != "healthy" ]; do
if [ $(date +%s) -gt $end_time ]; then
echo "Timeout: Container did not become healthy within 5 minutes."
docker logs tor-proxy # Print logs for debugging
docker logs tor-proxy
exit 1
fi
sleep 5
@@ -58,6 +58,4 @@ jobs:
echo "Container is healthy! Proceeding with next step."
- name: Show tor version
run: |
sleep 5
docker exec tor cat /app/package.json | grep version || echo "Could not get version"
run: docker exec tor-proxy tor --version || echo "Could not get version"

View File

@@ -2,7 +2,7 @@
services:
# Dein Tor Proxy
tor:
image: osminogin/tor-simple
image: .
container_name: tor-proxy
restart: always
ports: