-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdeploy
More file actions
executable file
·33 lines (25 loc) · 791 Bytes
/
deploy
File metadata and controls
executable file
·33 lines (25 loc) · 791 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
set -eu -o pipefail
bold=$(tput bold)
normal=$(tput sgr0)
current_branch=$(git branch --show-current)
current_hash=$(git rev-parse --short HEAD)
echo
printf "%sThis will deploy the current code on this machine (branch: %s, hash: %s) to the live environment on Firebase%s" "$bold" "$current_branch" "$current_hash" "$normal"
echo
read -r -p "Continue? [y/N] " -n 1
if [[ "$REPLY" =~ ^[Yy]$ ]]; then
echo
# Ensure the app deploy folder exists in the firebase folder
mkdir -p firebase/dist
# Clean out an existing build
rm -rf firebase/dist/app
# Build the production app and copy the output to the deploy folder
cd app
pnpm build
cp -r dist/app/browser/. ../firebase/dist/app
# Deploy to the live environment
cd ..
cd firebase
pnpm deploy:live
fi