perf(ci): push to local registry + SSH pipe (layers cacheable for future builds)
Deploy Dashboard (Dev) / Backend Tests (push) Successful in 1m15s
Deploy Dashboard (Dev) / Frontend Tests (push) Successful in 56s
Deploy Dashboard (Main) / Backend Tests (push) Successful in 2m40s
Deploy Dashboard (Main) / Frontend Tests (push) Successful in 5s
Deploy Dashboard (Main) / Build Main Image (push) Failing after 15s
Deploy Dashboard (Main) / Deploy to Production (push) Has been skipped
Deploy Dashboard (Dev) / Build Dev Image (push) Failing after 18s
Deploy Dashboard (Dev) / Deploy to Dev (push) Has been skipped
Deploy Dashboard (Dev) / Backend Tests (push) Successful in 1m15s
Deploy Dashboard (Dev) / Frontend Tests (push) Successful in 56s
Deploy Dashboard (Main) / Backend Tests (push) Successful in 2m40s
Deploy Dashboard (Main) / Frontend Tests (push) Successful in 5s
Deploy Dashboard (Main) / Build Main Image (push) Failing after 15s
Deploy Dashboard (Main) / Deploy to Production (push) Has been skipped
Deploy Dashboard (Dev) / Build Dev Image (push) Failing after 18s
Deploy Dashboard (Dev) / Deploy to Dev (push) Has been skipped
This commit is contained in:
+11
-12
@@ -174,22 +174,21 @@ jobs:
|
||||
git clone --depth=1 "http://100.78.131.124:3300/${GITHUB_REPOSITORY}.git" .
|
||||
fi
|
||||
|
||||
- name: Build Docker image
|
||||
- name: Build and transfer Docker image
|
||||
run: |
|
||||
set -e
|
||||
echo "Building on VPS (SSD)..."
|
||||
# Podman caches layers automatically; no --cache-from needed
|
||||
podman build -t nas-dashboard:latest dashboard/
|
||||
|
||||
- name: Transfer image to NAS
|
||||
run: |
|
||||
set -e
|
||||
REGISTRY="100.78.131.124:5501"
|
||||
TAG="$REGISTRY/nas-dashboard:$GITHUB_SHA"
|
||||
LATEST_TAG="$REGISTRY/nas-dashboard:latest"
|
||||
podman build -t "$TAG" -t "$LATEST_TAG" dashboard/
|
||||
echo "Pushing to local registry..."
|
||||
podman push --tls-verify=false "$TAG"
|
||||
podman push --tls-verify=false "$LATEST_TAG"
|
||||
echo "Streaming image to NAS..."
|
||||
SSH_OPTS="-o ConnectTimeout=15 -o ServerAliveInterval=15 -o ServerAliveCountMax=3"
|
||||
podman save nas-dashboard:latest | gzip | ssh $SSH_OPTS nasts "gunzip | /volume1/@appstore/ContainerManager/usr/bin/docker load 2>&1"
|
||||
echo "Retagging image..."
|
||||
ssh $SSH_OPTS 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"
|
||||
podman save "$LATEST_TAG" | gzip | ssh $SSH_OPTS nasts "gunzip | /volume1/@appstore/ContainerManager/usr/bin/docker load 2>&1"
|
||||
echo "Built, pushed, and transferred: $TAG"
|
||||
|
||||
deploy:
|
||||
name: Deploy to Production
|
||||
@@ -233,7 +232,7 @@ jobs:
|
||||
docker rm -f docker-socket-proxy nas-dashboard 2>/dev/null || true
|
||||
echo "Old containers stopped and removed"
|
||||
|
||||
# --pull never prevents overwriting the image we just built
|
||||
# --pull never prevents overwriting the image we just pulled
|
||||
docker compose -f /nas-dashboard/docker-compose.yml up -d --pull never 2>&1 || true
|
||||
|
||||
if ! docker container inspect nas-dashboard >/dev/null 2>&1; then
|
||||
|
||||
Reference in New Issue
Block a user