mirror of
https://github.com/Tencent/WeKnora.git
synced 2026-08-30 16:53:21 +08:00
1c31d649a7
- Added a new script `build_frontend_dist.sh` to handle the building of frontend static assets. - Updated `docker-compose.yml` to include a note about running the build script before building the frontend service. - Modified the GitHub Actions workflow to integrate the new build script for frontend assets. - Adjusted the Dockerfile to copy built assets directly from the `dist` directory. - Refined the `.dockerignore` to exclude unnecessary files while keeping the `dist` directory.
19 lines
491 B
Bash
Executable File
19 lines
491 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Build frontend static assets for Docker / release packaging.
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
|
|
if [ -z "${VITE_FRONTEND_COMMIT:-}" ]; then
|
|
# shellcheck source=/dev/null
|
|
eval "$("$PROJECT_ROOT/scripts/get_version.sh" env)"
|
|
export VITE_FRONTEND_COMMIT="${COMMIT_ID:-unknown}"
|
|
fi
|
|
|
|
export VITE_IS_DOCKER="${VITE_IS_DOCKER:-true}"
|
|
|
|
cd "$PROJECT_ROOT/frontend"
|
|
npm ci
|
|
npm run build
|