#!/usr/bin/env bash # Build the site. # # web/scripts/build.sh # # The build is named -[-dirty] from scripts/build-ref.sh; the # name shows in the site footer. push.sh builds and pushes. set -euo pipefail cd "$(dirname "$0")/../.." ref="${BUILD_REF:-$(scripts/build-ref.sh)}" cd web # The API origin is baked in at build time. The default is the production # API; override for a build that should talk to something else. export VITE_API_ORIGIN="${VITE_API_ORIGIN:-https://api.lance.blue}" # The site shows its own build in the footer; the same ref names the S3 # prefix push.sh syncs to, so what the page reports is where it is served # from. export VITE_BUILD_REF="$ref" npm run build echo echo "Built dist/ as $ref"