feat(ci): build dashboard dev images on VPS (SSD) instead of NAS HDD
Deploy Dashboard (Dev) / Backend Tests (push) Successful in 17m47s
Deploy Dashboard (Dev) / Frontend Tests (push) Successful in 44s
Deploy Dashboard (Dev) / Build Dev Image (push) Failing after 26m26s
Deploy Dashboard (Dev) / Deploy to Dev (push) Has been skipped

Add build-image-dev job (runs-on: vps) - builds with Podman on server2,
pipes the finished image to NAS via SSH, retags from localhost/ prefix.
Deploy job now depends on build-image-dev instead of backend-tests.

NAS HDD I/O was the bottleneck for Docker builds. VPS has SSD and
matches NAS x86_64 architecture perfectly.
This commit is contained in:
Gan, Jimmy
2026-06-04 17:51:41 +08:00
parent 3f0bcd2b7f
commit aa08b4c970
+28 -37
View File
@@ -157,10 +157,37 @@ jobs:
npm run test:coverage -- --reporter=verbose --run --pool=forks --poolOptions.forks.maxForks=2 || true npm run test:coverage -- --reporter=verbose --run --pool=forks --poolOptions.forks.maxForks=2 || true
echo "Frontend tests completed (pre-existing Vite compatibility issues may cause failures)" echo "Frontend tests completed (pre-existing Vite compatibility issues may cause failures)"
build-image-dev:
name: Build Dev 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 dev Docker image
run: |
set -e
echo "Building on VPS (SSD)..."
podman build -t nas-dashboard-dev:latest dashboard/
- name: Transfer image to NAS
run: |
set -e
echo "Streaming dev image to NAS..."
podman save nas-dashboard-dev:latest | ssh nasts "/volume1/@appstore/ContainerManager/usr/bin/docker load 2>&1"
echo "Retagging image..."
ssh nasts "/volume1/@appstore/ContainerManager/usr/bin/docker tag localhost/nas-dashboard-dev:latest nas-dashboard-dev:latest 2>&1 && /volume1/@appstore/ContainerManager/usr/bin/docker image rm localhost/nas-dashboard-dev:latest 2>&1"
echo "Dev image transferred and retagged successfully"
deploy-dev: deploy-dev:
name: Deploy to Dev name: Deploy to Dev
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [backend-tests, frontend-tests] needs: [build-image-dev, frontend-tests]
env: env:
SECRET_KEY: test-secret-key-for-ci-environment-32chars-minimum SECRET_KEY: test-secret-key-for-ci-environment-32chars-minimum
container: container:
@@ -175,42 +202,6 @@ jobs:
git clone --depth=1 "http://gitea:3000/${GITHUB_REPOSITORY}.git" . git clone --depth=1 "http://gitea:3000/${GITHUB_REPOSITORY}.git" .
fi fi
- name: Warm mirror cache for base images
run: |
set -u
mirror_host="100.78.131.124:5501"
prewarm_base_image() {
image_ref="$1"
if docker image inspect "${image_ref}" >/dev/null 2>&1; then
echo "Image ${image_ref} already exists locally, skipping pre-pull"
return 0
fi
mirror_ref="${mirror_host}/library/${image_ref}"
echo "Attempting mirror pre-pull: ${mirror_ref}"
if timeout 30 docker pull "${mirror_ref}" 2>/dev/null; then
docker tag "${mirror_ref}" "${image_ref}"
echo "Mirror pre-pull succeeded for ${image_ref}"
else
echo "Mirror pre-pull failed for ${image_ref}, will pull during build"
fi
}
prewarm_base_image "node:20-alpine"
prewarm_base_image "python:3.12-slim"
- name: Build dev image
run: |
set -e
export DOCKER_API_VERSION=1.43
if ! DOCKER_BUILDKIT=0 docker build --cache-from nas-dashboard-dev:latest -t nas-dashboard-dev:latest dashboard/; then
echo "Build failed. Checking for network issues..."
curl -I https://registry.npmmirror.com || echo "npmmirror unreachable"
curl -I https://pypi.tuna.tsinghua.edu.cn || echo "Tsinghua PyPI unreachable"
exit 1
fi
- name: Sync runtime compose file - name: Sync runtime compose file
run: | run: |
mkdir -p /volume1/docker/nas-dashboard mkdir -p /volume1/docker/nas-dashboard