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

+39
View File
@@ -0,0 +1,39 @@
#!/usr/bin/env bash
# Assemble a Next.js standalone tree ready for Dockerfile.prebuilt (runtime-only image).
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
OUT="${1:-$ROOT/prebuilt}"
test -f "$ROOT/.next/standalone/server.js"
test -f "$ROOT/.next/BUILD_ID"
rm -rf "$OUT"
mkdir -p "$OUT"
cp -a "$ROOT/.next/standalone/." "$OUT/"
rm -rf "$OUT/static" "$OUT/.next/static"
mkdir -p "$OUT/.next"
cp -a "$ROOT/.next/static/." "$OUT/.next/static/"
if [ -d "$ROOT/public" ]; then
rm -rf "$OUT/public"
cp -a "$ROOT/public" "$OUT/public"
else
mkdir -p "$OUT/public"
fi
cp "$ROOT/Dockerfile.prebuilt" "$OUT/Dockerfile"
printf '%s\n' 'Dockerfile' '.dockerignore' > "$OUT/.dockerignore"
test -f "$OUT/server.js"
test -f "$OUT/.next/BUILD_ID"
test -d "$OUT/.next/static"
test -d "$OUT/node_modules"
if [ -e "$OUT/static" ]; then
echo "ERROR: root-level static/ must not exist" >&2
exit 1
fi
echo "Prebuilt tree ready at $OUT"