Skip to main content

Getting Started

sbt-github-pages

sbt plugin to publish GitHub Pages with minimal effort.

Build Status Release Status

Maven Central Latest version

Get sbt-github-pages

In the project/plugins.sbt, add the following line,

addSbtPlugin("io.kevinlee" % "sbt-github-pages" % "0.14.0")

In your build.sbt,

lazy val root = (project in file("."))
.enablePlugins(GitHubPagesPlugin)
.settings(
name := "YOUR_PROJECT",
gitHubPagesOrgName := "USERNAME_OR_ORG",
gitHubPagesRepoName := "YOUR_PROJECT",
gitHubPagesSiteDir := baseDirectory.value / "path/to/github-pages-root"
)

To publish gh-pages, run the following task in sbt console

sbt:test-project> publishToGitHubPages 

or in bash or zsh

sbt publishToGitHubPages 

Why sbt-github-pages?

So why sbt-github-pages? There's already the sbt plugin called sbt-ghpages which does the same thing.

If you're using sbt-ghpages, that's good and you don't need to change it at all. sbt-ghpages is a great sbt plugin.

Difference between sbt-github-pages and sbt-ghpages is that sbt-github-pages uses GitHub API to push whereas sbt-ghpages uses git to push.

So to use sbt-github-pages, the only requirement is GitHub API access token which means you don't need to set anything if you're using GitHub Actions to publish since GitHub provides the access token in GitHub Actions build.

note

So sbt-github-pages works well with GitHub Actions.