forked from pure-admin/vue-pure-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.sh
30 lines (25 loc) · 752 Bytes
/
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
#!/usr/bin/env sh
# Replace packaging path
sed -i "s#VITE_PUBLIC_PATH = /#VITE_PUBLIC_PATH = /vue-pure-admin/#g" $(pwd)/.env.production
# Make sure the script throws the error encountered
set -e
pnpm build
cd dist
touch README.md .nojekyll
# deploy to github
if [ -z "$GITHUB_TOKEN" ]; then
msg='deploy'
[email protected]:xiaoxian521/vue-pure-admin.git
else
msg='ci: Automatic deployment from github actions'
githubUrl=https://xiaoxian521:${GITHUB_TOKEN}@github.com/xiaoxian521/vue-pure-admin.git
git config --global user.name "xiaoxian521"
git config --global user.email "[email protected]"
fi
git init
git add -A
git commit -m "${msg}"
# Push to github gh-pages branch
git push -f $githubUrl master:gh-pages
cd -
rm -rf dist