chore: deploy.sh builds and pushes both backend and frontend images
Some checks failed
lint / lint (push) Has been cancelled
test / unit (push) Has been cancelled
test / integration (push) Has been cancelled
lint / lint (pull_request) Has been cancelled
test / unit (pull_request) Has been cancelled
test / integration (pull_request) Has been cancelled
Some checks failed
lint / lint (push) Has been cancelled
test / unit (push) Has been cancelled
test / integration (push) Has been cancelled
lint / lint (pull_request) Has been cancelled
test / unit (pull_request) Has been cancelled
test / integration (pull_request) Has been cancelled
This commit is contained in:
25
deploy.sh
25
deploy.sh
@@ -1,9 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
IMAGE="registry.gabrielkaszewski.dev/thoughts:latest"
|
||||
REGISTRY="registry.gabrielkaszewski.dev"
|
||||
BACKEND_IMAGE="$REGISTRY/thoughts:latest"
|
||||
FRONTEND_IMAGE="$REGISTRY/thoughts-frontend:latest"
|
||||
|
||||
# Public API URL seen by the browser.
|
||||
# Override with: NEXT_PUBLIC_API_URL=https://api.example.com ./deploy.sh
|
||||
API_URL="${NEXT_PUBLIC_API_URL:-https://thoughts.gabrielkaszewski.dev}"
|
||||
|
||||
# Internal API URL used by Next.js SSR (can be a Docker-internal address in prod).
|
||||
# Override with: NEXT_PUBLIC_SERVER_SIDE_API_URL=http://api:8000 ./deploy.sh
|
||||
SSR_API_URL="${NEXT_PUBLIC_SERVER_SIDE_API_URL:-$API_URL}"
|
||||
|
||||
echo "==> building backend image: $BACKEND_IMAGE"
|
||||
docker buildx build --platform linux/amd64 \
|
||||
-t "$IMAGE" --push .
|
||||
-t "$BACKEND_IMAGE" --push .
|
||||
|
||||
echo "pushed $IMAGE"
|
||||
echo "==> building frontend image: $FRONTEND_IMAGE"
|
||||
docker buildx build --platform linux/amd64 \
|
||||
--build-arg "NEXT_PUBLIC_API_URL=$API_URL" \
|
||||
--build-arg "NEXT_PUBLIC_SERVER_SIDE_API_URL=$SSR_API_URL" \
|
||||
-t "$FRONTEND_IMAGE" --push \
|
||||
./thoughts-frontend
|
||||
|
||||
echo "==> pushed $BACKEND_IMAGE"
|
||||
echo "==> pushed $FRONTEND_IMAGE"
|
||||
|
||||
Reference in New Issue
Block a user