0.0.1 • Published 8 years ago
publish-gh-pages v0.0.1
publish-gh-pages
Publish your website to GitHub Pages.
Usage
Install
publish-gh-pagespackage into your project.npm install publish-gh-pagesInitial Travis CI yml file.
gh-pages init
Using Travis CI publishing your site
- Go to https://github.com/settings/tokens and generate a new personal access token.
- Using your GitHub account, add the Travis CI app to the repository you want to activate.
- Open your Travis CI dashboard. The URL looks like https://travis-ci.com/USERNAME/REPO, and navigate to the
More options>Setting>Environment Variablessection of your repository. - Create a new environment variable named
GH_TOKENwith your newly generated token as its value, thenGH_EMAIL(your email address) andGH_NAME(your GitHub username). - Check and modify a
.travis.ymlfile on the root of your repository with proper setting.
Command
Once you install publish-gh-pages package, you can use command below:
gh-pages initgh-pages publish
Initialize config and CI script
Use gh-pages init to create needed config files.
- .gh-pages.json
- .travis.yml
gh-pages publish
Configuration
In the root of project folder should has configuration file, .gh-pages.json. It should following structure:
{
"projectName": "demo-web-app",
"organizationName": "poychang",
"buildCommand": "ng build --base-href /demo-web-app/",
"distRoot": "./dist",
"distFolder": "DemoWebApp",
"branch": "gh-pages",
"commit": "Update demonstration web app"
}0.0.1
8 years ago