-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy
More file actions
executable file
·39 lines (32 loc) · 824 Bytes
/
deploy
File metadata and controls
executable file
·39 lines (32 loc) · 824 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
34
35
36
37
38
39
#!/usr/bin/env bash
BLUE=$(printf '\033[36m')
NORMAL=$(printf '\033[m')
# export NODE_DEBUG=gh-pages
timestamp=$(yarn node -e "console.log(new Date())")
gh_pages_args="--dist build --dotfiles --remove .DS_Store --message \"Update $timestamp\""
log_and_run_cmd () {
echo -e "+ ${BLUE}yarn $*${NORMAL}" && eval "$@"
echo
}
deploy_event () {
log_and_run_cmd run switch event
log_and_run_cmd run build
log_and_run_cmd gh-pages "$gh_pages_args"
}
deploy_homepage () {
log_and_run_cmd run switch homepage
log_and_run_cmd run build
log_and_run_cmd gh-pages --branch main "$gh_pages_args"
}
if [ "$1" == "event" ]; then
deploy_event
elif [ "$1" == "homepage" ]; then
deploy_homepage
elif [ "$1" == "all" ]; then
deploy_event
deploy_homepage
else
echo "Invalid argument"
exit 1
fi
run switch event