npm gh-pages publish script

Katya Pavlenko
1 min readMar 25, 2016

--

Если у вас есть проект на github, который вы хостите на gh-pages и надоело постоянно переключаться между ветками, то вот вам npm-скрипт!

Он размещается в package.json и в моем случае включает в себя еще и сборку всего при помощи webpack.

"scripts": {
"deploy": "NODE_ENV=production webpack",
"publish": "git checkout gh-pages &&
git merge master &&
npm run deploy &&
git commit -am 'Deploy' &&
git push origin gh-pages &&
git checkout @{-1}"
},

Готово, вы великолепны!

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Katya Pavlenko
Katya Pavlenko

Written by Katya Pavlenko

frontend developer, love instant noodles and super simple explanations of complex things Github: https://github.com/cakeinpanic

Responses (2)

Write a response