Setup GitHub Pages Projects for ReactJs or VueJs.
Require:
or
Setup GitHub Pages Projects for ReactJs or VueJs.
Require:
or
#!/bin/bash | |
# Setup GitHub Pages for ReactJs | |
# Set build to master branch | |
# using create-react-app | |
# | |
# Example | |
# setupghpreact [UserName] [RepositoryName].github.io | |
create-react-app $2 | |
cd $2 | |
npm install | |
npm run build | |
git init | |
git remote add origin [email protected]:$1/$2.github.io.git | |
git checkout -b dev | |
git add . | |
git commit -m "Initial Dev Commit" | |
git push origin dev | |
cd build | |
git init | |
git remote add origin [email protected]:$1/$2.github.io.git | |
git add . | |
git commit -m "Initial Build Commit" | |
git push origin master |
#!/bin/bash | |
# Setup GitHub Pages for VueJs | |
# Set build to master branch | |
# using vue-cli | |
# | |
# Example | |
# setupghpvuejs [UserName] [RepositoryName].github.io | |
# create a new project using the "webpack" template | |
vue init webpack $2 | |
# install dependencies | |
cd $2 | |
npm install --save vue-gh-pages | |
npm install | |
# Creating production build | |
node ./node_modules/vue-gh-pages/index.js | |
# Or | |
# Add ["deploy": "node ./node_modules/vue-gh-pages/index.js"] to package.json | |
# And run "npm run deploy" | |
# Init gh repository | |
git init | |
git remote add origin [email protected]:$1/$2.github.io.git | |
git checkout -b dev | |
git add . | |
git commit -m "Initial Dev Commit" | |
git push origin dev | |
cd docs | |
git init | |
git remote add origin [email protected]:$1/$2.github.io.git | |
git add . | |
git commit -m "Initial Build Commit" | |
git push origin master |