publisher is a small CLI for publishing static sites to GitHub Pages.
To publish a given target:
publisher -T <target>
Usage of publisher:
-p, --path string The path to the publisher.sc config file. (default "publisher.sc")
--skip-prerun Skip preRun step.
-t, --tag string The git tag to create. Omit if you do not want to create a tag.
-T, --target string The target to deploy.
-v, --verbose Enables verbose logging.
You can run publisher -h
to view the help message.
To configure publisher create a publisher.sc
file. An example is available in publisher.example.sc
.
The commit message to use. The following variables can be used:
${SHA}
- The SHA of the latest git commit.${DATE}
- The current date formatted asMM-DD-YYYY
.${TAG}
- The Git tag being created that was supplied by the--tag
flag.
A list of files/directories to be published.
A shell command to execute before publishing the site.
Example: yarn build
to create a production build.
A map of targets that can be published to. Publisher can be configured to publish to multiple GitHub repos in order to deploy different versions of a site.
Example:
targets: {
production: {
branch: "gh-pages"
repo: "Example/my-site"
url: "custom.example.com"
}
}
A target has the following fields:
The branch that is used for GitHub Pages. This is usually gh-pages
or master
.
The GitHub repo to publish to. Must be of the form <org>/<name>
.
A custom domain that the GitHub Pages site should use.
If provided, publisher will generate a CNAME
file with this value.
publisher is available under the MIT License.
Open an issue or submit a pull request.