forked from paritytech/substrate-connect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.sh
executable file
·48 lines (40 loc) · 1.22 KB
/
deploy.sh
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
40
41
42
43
44
45
46
47
48
#!/usr/bin/env bash
set -euxo pipefail
die() {
local msg="$*"
[[ -z "${msg}" ]] || {
echo "${RED}${msg}${RESET}" 1>&2
}
exit 1
}
readonly -f die
directory=_site
branch=gh-pages
echo -e "Deleting old content..."
rm -rf $directory
echo -e "Checking out $branch...."
git worktree add $directory -f $branch
echo -e "Rebuilding everything..."
pnpm build
echo -e "Generating site..."
echo "Init demo for github pages process..."
rm -rf ./$directory/*
mkdir -p ./$directory/burnr
mkdir -p ./$directory/demo
mkdir -p ./$directory/extension
touch ./$directory/.nojekyll
echo "Place burnr wallet demo's files."
cp -r ./projects/burnr/dist/* ./$directory/burnr/.
echo "Place multi-demo's files."
cp -r ./projects/demo/dist/* ./$directory/demo/.
# echo "Place Substrate-connect extension's zip."
# cp ./projects/extension/dist/packed-extension.zip ./$directory/extension/packed-extension.zip
echo "Generate API docs."
pnpm api-docs
echo -e "Deploying $branch branch..."
cd $directory &&
git add --all &&
GIT_COMMITTER_NAME='Docs builder' GIT_COMMITTER_EMAIL='[email protected]' git commit --author "Docs builder <[email protected]>" -m "Deploy updates" &&
git push origin $branch
echo -e "Cleaning up..."
git worktree remove -f $directory