damus.io

damus.io website
git clone git://jb55.com/damus.io
Log | Files | Refs | README | LICENSE

commit b84fb5281a8a93d04fc5624215e14912d73d21bf
parent decdd2deedb1780120083ffc230e11b518db081f
Author: William Casarin <jb55@jb55.com>
Date:   Tue, 30 Jan 2024 13:40:58 -0800

build: update build and deploy scripts

Signed-off-by: William Casarin <jb55@jb55.com>

Diffstat:
Mbuild | 18++++++++++++++----
Adeploy | 7+++++++
2 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/build b/build @@ -1,16 +1,26 @@ #!/usr/bin/env bash +set -eo pipefail + env=$1 npm run i18n if [ "$env" == "staging" ] then + export OUT_DIR="$PWD/out-staging" export NEXT_PUBLIC_PURPLE_API_BASE_URL="https://api-staging.damus.io" - npx next build - mv out out-staging else + export OUT_DIR="$PWD/out-production" export NEXT_PUBLIC_PURPLE_API_BASE_URL="https://api.damus.io" - npx next build - mv out out-production fi + +npx next build +rm -rf "$OUT_DIR" +mv out "$OUT_DIR" + + +# TODO: next doesn't seem to set this up properly. bug? +mkdir -p "$OUT_DIR/purple/checkout" +ln "$OUT_DIR/purple.html" "$OUT_DIR/purple/index.html" +ln "$OUT_DIR/purple/checkout.html" "$OUT_DIR/purple/checkout/index.html" diff --git a/deploy b/deploy @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +./build +./build staging + +rsync -avzP out-production/ purple:/www/damus.io/ +rsync -avzP out-staging/ purple:/www/staging.damus.io/