npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

git-update-ghpages

v1.3.0

Published

Update GitHub pages from the command line

Downloads

5,091

Readme

git-update-ghpages

Uploads a directory to gh-pages. Perfect for use with Travis-CI deployments.

git-update-ghpages rstacruz/myproject _docs
==> cd /var/folders/7d/tmp.9dgEYWLD
==> git init
Initialized empty repository in /var/folders/7d/tmp.9dgEYWLD

==> git checkout -b gh-pages
Switch to a new branch 'gh-pages'

==> Copying contents from _docs
x index.html
x license.html
x contributing.html

==> git commit -m Update
[gh-pages 06829a94] Update
  16 files changed, 16085 insertions(+)

==> git push https://github.com/rstacruz/myproject.git gh-pages
==> rm -rf /var/folders/7d/tmp.9dgEYWLD
==> Done.

Status

Travis deployment

You can use Travis to automatically deploy your static website to GitHub pages.

Generate a GitHub token

Generate a GitHub token. Travis will use this to push to your repository on your behalf. You can use any name, but you can call it Travis CI. Keep this token somewhere safe; you can use it for any of your repositories that will need git-update-ghpages deployments.

Adding your token

Make sure Travis is already enabled on your repository. Go to your Travis's repo's settings page (https://travis-ci.org/user/repo/settings), and add your token there as GITHUB_TOKEN. Be sure to turn off the "show this in build log" option.

Alternatively, you can also use the Travis CLI tool to add this to your repo as a secure variable:

travis encrypt GITHUB_TOKEN="your token here" --add

Configuring builds

Add this to your .travis.yml manifest. This will make a build happen after your test, then a deployment right after that. uIn this example, we're deploying _docs to user/repo.

# .travis.yml
node_js:
- '4'

env:
  global:
    - GIT_NAME: Travis CI
    - GIT_EMAIL: [email protected]
    - GITHUB_REPO: rstacruz/myproject
    - GIT_SOURCE: docs

script:
- npm test     # ...or whatever your test command is
- make build   # ...or whatever your build command is

after_success:
- if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then npm install git-update-ghpages && ./node_modules/.bin/git-update-ghpages -e; fi

For Node.js projects

If your project is a Node.js project, you can simplify this by adding git-update-ghpages to your devDependencies.

npm install --save-dev --save-exact git-update-ghpages
# .travis.yml
after_success:
- if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then ./node_modules/.bin/git-update-ghpages -e; fi