Refactor deployment workflow to utilize GitHub Actions for improved efficiency. Updated deploy.yml to include actions for checkout and Node.js setup, streamlined build process for Next.js with prebuilt assets, and revised deployment script to eliminate unnecessary steps. Enhanced documentation for clarity on automated deployment process.

This commit is contained in:
smhk1376 committed 2026-10-20 01:17:13 +03:30
1 parent bd2cfa5a26
commit e1b5286946
5 files changed
+90 -39

No files matched your search

+12 -3
View File
@@ -18,9 +18,18 @@ docker inspect insaight-postgres --format '{{json .NetworkSettings.Networks}}' |
docker volume create "$UPLOAD_VOLUME" >/dev/null
# Keep the current app running throughout the build.
DOCKER_BUILDKIT=1 docker build \
--build-arg NEXT_PUBLIC_SITE_URL=https://edu.mstaut.ir \
-t "$IMAGE" .
# PREBUILT_DIR: CI-assembled standalone tree (Dockerfile.prebuilt). Skips npm ci + next build on VPS (~1–2 min).
PREBUILT_DIR="${PREBUILT_DIR:-}"
if [ -n "$PREBUILT_DIR" ]; then
test -f "$PREBUILT_DIR/server.js"
test -f "$PREBUILT_DIR/Dockerfile"
rm -rf "$PREBUILT_DIR/static"
DOCKER_BUILDKIT=1 docker build -t "$IMAGE" "$PREBUILT_DIR"
else
DOCKER_BUILDKIT=1 docker build \
--build-arg NEXT_PUBLIC_SITE_URL=https://edu.mstaut.ir \
-t "$IMAGE" .
fi
# Back up before applying the repository's transactional, versioned migrations.
# Migrations are forward-only and idempotent (schema_migrations); dump is the safety net.