Fix Gitea deploy: restore VPS shell workflow without GitHub Actions.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
e1b5286946
commit
29b71c228e
2 files changed
+48
-14
No files matched your search
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env bash
|
||||
# Run on the VPS after the repo is checked out (Gitea local-host runner).
|
||||
# No GitHub Actions dependencies — only git, Docker, and bash.
|
||||
set -euo pipefail
|
||||
|
||||
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
cd "$ROOT"
|
||||
|
||||
export DISABLE_REACT_COMPILER=1
|
||||
export NEXT_TELEMETRY_DISABLED=1
|
||||
export NEXT_PUBLIC_SITE_URL="${NEXT_PUBLIC_SITE_URL:-https://edu.mstaut.ir}"
|
||||
export NODE_OPTIONS="${NODE_OPTIONS:---max-old-space-size=3072}"
|
||||
|
||||
echo "Building Next.js at $ROOT (Node 22 container)…"
|
||||
DOCKER_BUILDKIT=1 docker run --rm \
|
||||
-e DISABLE_REACT_COMPILER=1 \
|
||||
-e NEXT_TELEMETRY_DISABLED=1 \
|
||||
-e NEXT_PUBLIC_SITE_URL \
|
||||
-e NODE_OPTIONS \
|
||||
-v "$ROOT:/app" -w /app \
|
||||
--mount type=cache,target=/root/.npm \
|
||||
node:22-alpine \
|
||||
sh -ec 'npm ci --no-audit --no-fund && npm run build'
|
||||
|
||||
bash scripts/assemble-prebuilt.sh "$ROOT/prebuilt"
|
||||
rm -rf "$ROOT/prebuilt/static"
|
||||
PREBUILT_DIR="$ROOT/prebuilt" bash scripts/deploy-production.sh
|
||||
Reference in new issue
Block a user