2024-02-03 06:04:34 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# This script is run by the Cloudflare Pages integration when deploying the apps
|
2024-02-10 09:31:09 +00:00
|
|
|
# in this repository. The app to build and the environment variables to use is
|
|
|
|
# decided based on the the value of the CF_PAGES_BRANCH environment variable.
|
2024-02-03 06:04:34 +00:00
|
|
|
#
|
|
|
|
# Ref: https://developers.cloudflare.com/pages/how-to/build-commands-branches/
|
|
|
|
|
|
|
|
set -o errexit
|
2024-02-03 11:03:51 +00:00
|
|
|
set -o xtrace
|
2024-02-03 06:04:34 +00:00
|
|
|
|
2024-02-10 09:31:09 +00:00
|
|
|
# The Cloudflare Pages build configuration is set to use `out/` as the build
|
|
|
|
# output directory, so once we're done building we copy the app specific output
|
|
|
|
# to `out/` (symlinking didn't work).
|
|
|
|
|
2024-02-03 11:19:50 +00:00
|
|
|
rm -rf out
|
|
|
|
|
2024-02-10 09:31:09 +00:00
|
|
|
if test "$CF_PAGES_BRANCH" = "photos-release"; then
|
|
|
|
yarn export:photos
|
|
|
|
cp -R apps/photos/out .
|
|
|
|
elif test "$CF_PAGES_BRANCH" = "auth-release"; then
|
2024-02-03 06:04:34 +00:00
|
|
|
yarn export:auth
|
2024-02-03 11:19:50 +00:00
|
|
|
cp -R apps/auth/out .
|
2024-02-16 09:59:34 +00:00
|
|
|
elif test "$CF_PAGES_BRANCH" = "accounts-release"; then
|
|
|
|
yarn export:accounts
|
|
|
|
cp -R apps/accounts/out .
|
2024-02-03 06:04:34 +00:00
|
|
|
else
|
|
|
|
yarn export:photos
|
2024-02-03 11:42:25 +00:00
|
|
|
cp -R apps/photos/out .
|
2024-02-03 06:04:34 +00:00
|
|
|
fi
|