Merge branch 'main' into dev
Deploy Dashboard (Main) / Backend Tests (push) Failing after 32s
Deploy Dashboard (Main) / Build Main Image (push) Has been skipped
Deploy Dashboard (Dev) / Backend Tests (push) Successful in 1m8s
Deploy Dashboard (Dev) / Frontend Tests (push) Successful in 53s
Deploy Dashboard (Main) / Frontend Tests (push) Failing after 5s
Deploy Dashboard (Main) / Deploy to Production (push) Has been skipped
Deploy Dashboard (Dev) / Build Dev Image (push) Successful in 1m34s
Deploy Dashboard (Dev) / Deploy to Dev (push) Failing after 0s
Deploy Dashboard (Main) / Backend Tests (push) Failing after 32s
Deploy Dashboard (Main) / Build Main Image (push) Has been skipped
Deploy Dashboard (Dev) / Backend Tests (push) Successful in 1m8s
Deploy Dashboard (Dev) / Frontend Tests (push) Successful in 53s
Deploy Dashboard (Main) / Frontend Tests (push) Failing after 5s
Deploy Dashboard (Main) / Deploy to Production (push) Has been skipped
Deploy Dashboard (Dev) / Build Dev Image (push) Successful in 1m34s
Deploy Dashboard (Dev) / Deploy to Dev (push) Failing after 0s
# Conflicts: # .gitea/workflows/deploy-dev.yml # .gitea/workflows/deploy.yml
This commit is contained in:
+21
-14
@@ -14,7 +14,7 @@ concurrency:
|
||||
jobs:
|
||||
backend-tests:
|
||||
name: Backend Tests
|
||||
runs-on: vps
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
SECRET_KEY: test-secret-key-for-ci-environment-32chars-minimum
|
||||
|
||||
@@ -22,7 +22,7 @@ jobs:
|
||||
- name: Checkout repository
|
||||
run: |
|
||||
if [ ! -d .git ]; then
|
||||
git clone --depth=1 "http://100.78.131.124:3300/${GITHUB_REPOSITORY}.git" .
|
||||
git clone --depth=1 "http://172.21.0.1:3300/${GITHUB_REPOSITORY}.git" .
|
||||
fi
|
||||
|
||||
- name: Setup Python
|
||||
@@ -172,39 +172,40 @@ jobs:
|
||||
name: Build Main Image
|
||||
runs-on: vps
|
||||
needs: [backend-tests]
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
run: |
|
||||
if [ ! -d .git ]; then
|
||||
git clone --depth=1 "http://100.78.131.124:3300/${GITHUB_REPOSITORY}.git" .
|
||||
fi
|
||||
- name: Build main Docker image
|
||||
|
||||
- name: Build Docker image
|
||||
run: |
|
||||
set -e
|
||||
echo "Building on VPS (SSD)..."
|
||||
CACHE_ARG=""
|
||||
if podman image exists nas-dashboard:latest 2>/dev/null; then
|
||||
CACHE_ARG="--cache-from nas-dashboard:latest"
|
||||
fi
|
||||
podman build $CACHE_ARG -t nas-dashboard:latest dashboard/
|
||||
# Podman caches layers automatically; no --cache-from needed
|
||||
podman build -t nas-dashboard:latest dashboard/
|
||||
|
||||
- name: Transfer image to NAS
|
||||
run: |
|
||||
set -e
|
||||
echo "Streaming main image to NAS..."
|
||||
echo "Streaming image to NAS..."
|
||||
podman save nas-dashboard:latest | ssh nasts "/volume1/@appstore/ContainerManager/usr/bin/docker load 2>&1"
|
||||
echo "Main image transferred successfully"
|
||||
echo "Retagging image..."
|
||||
ssh nasts "/volume1/@appstore/ContainerManager/usr/bin/docker tag localhost/nas-dashboard:latest nas-dashboard:latest 2>&1 && /volume1/@appstore/ContainerManager/usr/bin/docker image rm localhost/nas-dashboard:latest 2>&1"
|
||||
echo "Image transferred and retagged successfully"
|
||||
|
||||
deploy:
|
||||
name: Deploy to Production
|
||||
runs-on: nas
|
||||
if: always()
|
||||
if: always() && needs.build-image-main.result == 'success'
|
||||
needs: [build-image-main, frontend-tests]
|
||||
env:
|
||||
SECRET_KEY: test-secret-key-for-ci-environment-32chars-minimum
|
||||
GITEA_DB_PASSWORD: nyM3P4v1aYAsT7zfUtdguImNVHgFltCKCY/OjzWZVRE=
|
||||
container:
|
||||
network: gitea_gitea
|
||||
options: --add-host=host.docker.internal:host-gateway --dns 192.168.31.1 --dns 8.8.8.8
|
||||
volumes:
|
||||
- /var/packages/ContainerManager/target/usr/bin/docker:/usr/bin/docker
|
||||
- /volume1/docker/nas-dashboard:/nas-dashboard
|
||||
@@ -241,7 +242,7 @@ jobs:
|
||||
if ! docker container inspect nas-dashboard >/dev/null 2>&1; then
|
||||
echo "Compose failed, stripping networks and retrying..."
|
||||
docker rm -f docker-socket-proxy nas-dashboard 2>/dev/null || true
|
||||
# ... (python script for stripping networks) ...
|
||||
sed '/^networks:/,$d' /nas-dashboard/docker-compose.yml > /nas-dashboard/prod-ci.yml
|
||||
docker compose -f /nas-dashboard/prod-ci.yml up -d --pull never 2>&1 || true
|
||||
fi
|
||||
|
||||
@@ -304,7 +305,13 @@ jobs:
|
||||
|
||||
# Verify network connections
|
||||
echo "=== Network connections ==="
|
||||
docker inspect nas-dashboard --format '{{json .NetworkSettings.Networks}}' | python3 -c 'import json,sys;nets=json.load(sys.stdin);[print(f" Connected to {n}") for n in nets];assert "nas-dashboard_internal" in nets, "Missing nas-dashboard_internal";print("All network connections established")'
|
||||
if docker inspect nas-dashboard --format '{{json .NetworkSettings.Networks}}' | grep -q 'nas-dashboard_internal'; then
|
||||
echo " Connected to nas-dashboard_internal"
|
||||
echo "All network connections established"
|
||||
else
|
||||
echo "❌ Missing nas-dashboard_internal network"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Wait for container to be healthy
|
||||
echo "Waiting for container to be healthy..."
|
||||
|
||||
Reference in New Issue
Block a user