Skip to content

Commit a831ae5

Browse files
committed
feat(pages): deploy test for github pages
1 parent 5c22447 commit a831ae5

File tree

3 files changed

+31
-1
lines changed

3 files changed

+31
-1
lines changed

Diff for: deploy.sh

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env sh
2+
3+
# abort on errors
4+
set -e
5+
6+
# build
7+
npm run pages
8+
9+
# navigate into the build output directory
10+
cd dist
11+
12+
# if you are deploying to a custom domain
13+
# echo 'www.example.com' > CNAME
14+
15+
git init
16+
git add -A
17+
git commit -m 'deploy'
18+
19+
# if you are deploying to https://<USERNAME>.github.io
20+
# git push -f [email protected]:<USERNAME>/<USERNAME>.github.io.git master
21+
22+
# if you are deploying to https://<USERNAME>.github.io/<REPO>
23+
git push -f [email protected]:dreambo8563/ue-simple-drawer.git master:gh-pages
24+
25+
cd -

Diff for: package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"scripts": {
66
"serve": "vue-cli-service serve",
77
"build": "vue-cli-service build --target wc --name vue-simple-drawer src/components/Drawer/index.vue",
8-
"test": "vue-cli-service build --target wc --name vue-simple-drawer src/components/Drawer/index.vue",
8+
"test": "bash ./deploy",
9+
"pages": "vue-cli-service build",
910
"lint": "vue-cli-service lint",
1011
"test:unit": "vue-cli-service test:unit",
1112
"report": "vue-cli-service build --report",

Diff for: vue.config.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
publicPath:
3+
process.env.NODE_ENV === "production" ? "/vue-simple-drawer/" : "/"
4+
};

0 commit comments

Comments
 (0)