JSPM

@auto-canary/gh-pages

11.3.0--canary.2478.87bcf4d47797ed8cc7152538b86fd742d8d19462.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 90
  • Score
    100M100P100Q102903F
  • License MIT

Automate publishing to your gh-pages documentation website

Package Exports

  • @auto-canary/gh-pages
  • @auto-canary/gh-pages/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@auto-canary/gh-pages) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

GitHub Pages Plugin

Automate publishing to your gh-pages documentation website

auto will push a directory to your project's gh-pages branch:

  1. on every release
  2. if the documentation label is on the pull request

What is a gh-pages branch?

The gh-pages branch is a special branch in your repository that you can use to store your built website. This branch will not track any of the source files for your project, but will have things like an index.html and all the other files needed to render your website. The benefit of this is that you don't have to store any dist files in your baseBranch.

Take a look at auto's gh-pages branch/

Installation

This plugin is not included with the auto CLI installed via NPM. To install:

npm i --save-dev @auto-it/gh-pages
# or
yarn add -D @auto-it/gh-pages

Usage

All you need to do a provide that path to your build documentation website.

{
  "plugins": [
    ["gh-pages", { "dir": "./path/to/built/docs/website" }]
    // other plugins
  ]
}

Build Your Docs

If you also want auto to run the build for you docs site provide the buildCommand option.

{
  "plugins": [
    [
      "gh-pages",
      {
        "buildCommand": "npm run build:docs",
        "dir": "./path/to/built/docs/website"
      }
    ]
    // other plugins
  ]
}

You must also make sure that your built website is in your .gitignore. Otherwise your release will fail because of uncommitted changes.

.gitignore:

./path/to/built/docs/website

Pages Branch

You can configure the branch auto pushes to with the branch option.

{
  "plugins": [
    [
      "gh-pages",
      {
        "branch": "docs",
        "dir": "./path/to/built/docs/website"
      }
    ]
    // other plugins
  ]
}

Documentation Label

You can configure the label auto looks for with the label option.

{
  "plugins": [
    [
      "gh-pages",
      {
        "label": "website",
        "dir": "./path/to/built/docs/website"
      }
    ]
    // other plugins
  ]
}