Skip to content

Instantly share code, notes, and snippets.

@amimaro
Last active March 16, 2018 13:04
Show Gist options
  • Save amimaro/eee6dfe0b5d50dea395d3d10e1e66764 to your computer and use it in GitHub Desktop.
Save amimaro/eee6dfe0b5d50dea395d3d10e1e66764 to your computer and use it in GitHub Desktop.
Setup GitHub Pages Projects
#!/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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment