-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild.sh
More file actions
30 lines (24 loc) · 772 Bytes
/
build.sh
File metadata and controls
30 lines (24 loc) · 772 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
#!/usr/bin/env sh
BASE_DIR="home/runner/work/blog"
DIST_BRANCH="dist"
echo "Building Started...."
pnpm build
echo "Building Completed."
echo "Deploying Started...."
mkdir -p "${BASE_DIR}""/temp"
mv docs "${BASE_DIR}""/temp"
mkdir -p "${BASE_DIR}""/temp/docs/src"
cp -r src/assets "${BASE_DIR}""/temp/docs/src/assets"
rm -rf "${BASE_DIR}""/temp/docs/src/assets/**/*.md"
git fetch origin ${DIST_BRANCH}
git checkout ${DIST_BRANCH}
rm -rf docs
mv "${BASE_DIR}"/temp/docs .
if [ -n "$(git status --porcelain)" ]; then
echo "blog.jankaritech.com" > docs/CNAME
git add .
git -c user.name="JT Action Bot" -c user.email="info@jankaritech.com" commit -m "Update the build code"
git push origin ${DIST_BRANCH}
fi
rm -rf "${BASE_DIR}""/temp"
echo "Deploying Completed"